This commit is contained in:
Hans Dembinski
2017-04-25 10:45:37 +02:00
parent 8aac475d72
commit 812b607947
2 changed files with 9 additions and 6 deletions

View File

@@ -101,6 +101,14 @@ template <typename T> python::object axis_getitem(const T &t, int i) {
return python::object(t[i]);
}
template <> python::object axis_getitem(const category_axis &t, int i) {
if (i == axis_len(t)) {
PyErr_SetString(PyExc_StopIteration, "no more");
python::throw_error_already_set();
}
return python::object(t[i].data());
}
template <typename T> std::string axis_repr(const T &t) {
std::ostringstream os;
os << t;