It can be natural to change an axis using __setattr__ (as gb tried to do) but it leads to a very confusing problem where the real array axis is different from the attribute axis. For example, to change the type of an axis:
>>> arr = ndtest('a=1,2,total')[:'2']
>>> arr.a.dtype
dtype('<U21')
>>> arr.a = arr.a.astype(int)
>>> arr.a.dtype
dtype('int64')
>>> arr.axes['a'].dtype
dtype('<U21')
>>> arr.a is arr.axes['a']
False
We should either make it work or make it an explicit error.
It can be natural to change an axis using
__setattr__(as gb tried to do) but it leads to a very confusing problem where the real array axis is different from the attribute axis. For example, to change the type of an axis:We should either make it work or make it an explicit error.