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
In Python 2 or 3 with Numpy 1.7.1 there seems to be problem with np.rec.fromarrays creating a dtype format that is a factor of 4 too large:
In [5]: a = np.array([u'xyz'])
In [6]: a.dtype
Out[6]: dtype('<U3')
In [7]: a2 = np.rec.fromarrays([a], names=['a'])
In [8]: a2.dtype
Out[8]: dtype([('a', '<U12')])
In [9]: a3 = np.rec.fromarrays([a2['a']], names=['a'])
In [10]: a3.dtype
Out[10]: dtype([('a', '<U48')])
It looks like the problem is here, where here itemsize is 12 for a 3-character unicode string with UCS-4 encoding:
if issubclass(obj.dtype.type, nt.flexible):
formats += repr(obj.itemsize)
The text was updated successfully, but these errors were encountered:
In Python 2 or 3 with Numpy 1.7.1 there seems to be problem with
np.rec.fromarrays
creating a dtype format that is a factor of 4 too large:It looks like the problem is here, where here
itemsize
is 12 for a 3-character unicode string with UCS-4 encoding:The text was updated successfully, but these errors were encountered: