boostorg / histogram

Fast multi-dimensional generalized histogram with convenient interface for C++14
Boost Software License 1.0
315 stars 73 forks source link

Add slicing support for category axis #267

Closed HDembinski closed 4 years ago

HDembinski commented 4 years ago

category axes are currently not sliceable (see reduce algorithm), because slicing didn't seem to make sense for category axes.

However, https://github.com/scikit-hep/boost-histogram/issues/296 suggests that also category axis should be sliceable, and eventually one should be able to pick individual bin indices as well. Perhaps using the keyword pick(index1, index2, ...) as suggested by @henryiii

henryiii commented 4 years ago

Note on pick: you need both an index and an axes number, since the difference with .at() is that you will leave some axes alone and get a histogram back. Or some way to indicate that an axes should be kept. It would be quite useful for integer (+boolean) axes and category axes, I believe.

HDembinski commented 4 years ago

The patch for making category axis sliceable is almost done https://github.com/HDembinski/histogram/pull/103

HDembinski commented 4 years ago

closed in develop