Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode column names not supported #59

Open
ChrisBeaumont opened this issue Apr 12, 2013 · 0 comments
Open

Unicode column names not supported #59

ChrisBeaumont opened this issue Apr 12, 2013 · 0 comments
Milestone

Comments

@ChrisBeaumont
Copy link
Contributor

In the following line:

https://github.com/atpy/atpy/blob/master/atpy/basetable.py#L563

name might be a unicode string. However, my version of numpy (1.7) doesn't support unicode names passed to dtype at

https://github.com/atpy/atpy/blob/master/atpy/basetable.py#L579

This leads to a TypeError:

In [31]: np.array(zip([1,2]), dtype=[('ID', np.dtype('int32'))])
Out[31]: 
array([(1,), (2,)], 
      dtype=[('ID', '<i4')])

In [32]: np.array(zip([1,2]), dtype=[(u'ID', np.dtype('int32'))])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-32-b3fe14be618a> in <module>()
----> 1 np.array(zip([1,2]), dtype=[(u'ID', np.dtype('int32'))])

TypeError: data type not understood

One workaround is to coerce name to a non-unicode string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant