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

numpy compatibility? #214

Open
ssolari opened this issue Jun 22, 2016 · 0 comments
Open

numpy compatibility? #214

ssolari opened this issue Jun 22, 2016 · 0 comments

Comments

@ssolari
Copy link

ssolari commented Jun 22, 2016

Any thoughts or plans on addressing numpy compatibility? For analytics, numpy is pretty much required in python. The fact that the future-python module actually breaks code that works AS IS on both python2 and python3 is not good and makes using it frustrating for anyone who uses numpy.

For example a basic record array example will fail. http://docs.scipy.org/doc/numpy/user/basics.rec.html. #196 is a subset of the larger numpy compatibility

Python 2.7.11 |Anaconda 4.0.0 (x86_64)| (default, Dec  6 2015, 18:57:58) 
Type "copyright", "credits" or "license" for more information.

IPython 4.1.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import numpy as np

In [2]: x = np.array([(1, 2., 'Hello'), (2, 3., "World")], dtype=[('foo', 'i4'), ('bar', 'f4'), ('baz', 'S10')])

In [3]: from __future__ import absolute_import, division, print_function, unicode_literals

In [4]: from builtins import *

In [5]: x = np.array([(1, 2., 'Hello'), (2, 3., "World")], dtype=[('foo', 'i4'), ('bar', 'f4'), ('baz', 'S10')])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-ba687338dd1c> in <module>()
----> 1 x = np.array([(1, 2., 'Hello'), (2, 3., "World")], dtype=[('foo', 'i4'), ('bar', 'f4'), ('baz', 'S10')])

TypeError: data type not understood
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

2 participants