You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it supposed to be possible to use non-native unicode byteorder?
The unicode comparison functions cannot handle non-native byteorder, however this also applies to the dtype transfer functions. The copyswap functions do anticipate it, but only for 4-byte wide unicode (and I think there can be 2-byte wide as a compile option?), maybe that is why printing works...
In [19]: a=np.array(['asdf']).astype(unicode)
In [20]: a.byteswap().newbyteorder()
Out[20]:
array([u'asdf'],
dtype='>U4')
In [21]: a.astype('>U4')
Out[21]:
array([u'\U61000000\U73000000\U64000000\U66000000'],
dtype='>U4')
In [22]: a==a.byteswap().newbyteorder()
Out[22]: array([False], dtype=bool)
The text was updated successfully, but these errors were encountered:
ah ok, that makes sense... So things are a bit simpler. We will need a dedicated unicode dtype transfer function, and either use the new iterator or force a copy in the comparison functions
@jreback no idea if it interests you, but I just opened gh-7664 to hopefully fix this soonish. OOps, I had forgotten about the "numpy only uses 32bit" part, haha. Makes the code much nicer...
Is it supposed to be possible to use non-native unicode byteorder?
The unicode comparison functions cannot handle non-native byteorder, however this also applies to the dtype transfer functions. The copyswap functions do anticipate it, but only for 4-byte wide unicode (and I think there can be 2-byte wide as a compile option?), maybe that is why printing works...
The text was updated successfully, but these errors were encountered: