Closed
Description
I relatively often need to change an axis labels dtype. For example to convert labels to int64, I currently have to do:
>>> arr = ndtest("a=1..3")
>>> arr.a.dtype
dtype('int32')
>>> arr.set_labels('a', arr.a.labels.astype(np.int64))
>>> # this would be a tad shorter and makes sense IMO
... arr.set_labels('a', arr.a.astype(np.int64))
In an ideal world, arr.set_labels('a', np.int64)
would work too (but I am unsure it is possible). It currently returns an object array for the axis labels:
>>> arr.set_labels('a', np.int64).a.dtype
dtype('O')