larray-project / larray

N-dimensional labelled arrays in Python
https://larray.readthedocs.io/
GNU General Public License v3.0
8 stars 6 forks source link

Array.reindex fails when not specifying new axis name in dict #1120

Open gdementen opened 1 month ago

gdementen commented 1 month ago
>>> arr = ndtest(3)
>>> arr.reindex({'a': 'a1,a2,a3'})
[...]
KeyError: "axis 'a' not found in {{0}}"
>>> arr.reindex('a', 'a1,a2,a3')
a   a1   a2   a3
   1.0  2.0  nan
>>> arr.reindex({'a': 'a=a1,a2,a3'})
a   a1   a2   a3
   1.0  2.0  nan
>>> arr.reindex({'a': Axis('a=a1,a2,a3')})
a   a1   a2   a3
   1.0  2.0  nan

vs stumbled on this one