-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
TST: compat with numpy 1.14 #18123
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
Comments
in 1.13.3
cc @charris |
1.13.3 or current 1,14? In any case, this is probably numpy/numpy#9941. NumPy now has its own value -> string conversion functions and there will probably be some small changes in the output. However, the strings should maintain value on back conversion. |
Although back conversion doesn't succeed here.
So there may be other things going on. |
@ahaldane Thoughts? |
Yeah, just looks like a printing change
|
yep i think we can just fix the test on our side |
I see what is going on here. Numpy's casting code actually uses When casting from a
and that's using python's We can see this more clearly as follows using the numpy casting loop: >>> a = np.array([1.12345678901234567890])
>>> b = np.zeros(1, dtype='S20')
>>> b[:] = a
>>> b
array(['1.12345678901'],
dtype='|S20') Now let's avoid numpy's casting code by assigning directly: >>> b[0] = a[0]
>>> b
array(['1.1234567890123457'],
dtype='|S20') Compare to: >>> b[0] = str(float(a[0]))
>>> b
array(['1.12345678901'],
dtype='|S20') I see a few possible things we could do to make your tests work:
I might just try out option 1. |
Note that this is only a problem in python2, since This means your test probably fails in python3, even I don't precisely understand why our recent changes affected this test the way it did. Pandas probably has an overriden In any case, in numpy 1.14 we are planning not to truncate the |
COMPAT: compat with numpy >= 1.14 on str repr closes pandas-dev#18123
COMPAT: compat with numpy >= 1.14 on str repr TST: temp disable python-dateutil from master closes pandas-dev#18123
COMPAT: compat with numpy >= 1.14 on str repr TST: temp disable python-dateutil from master closes pandas-dev#18123
CI: don't show miniconda output on install COMPAT: compat with numpy >= 1.14 on str repr TST: temp disable python-dateutil from master closes #18123
…s-dev#18157) CI: don't show miniconda output on install COMPAT: compat with numpy >= 1.14 on str repr TST: temp disable python-dateutil from master closes pandas-dev#18123
…s-dev#18157) CI: don't show miniconda output on install COMPAT: compat with numpy >= 1.14 on str repr TST: temp disable python-dateutil from master closes pandas-dev#18123
…s-dev#18157) CI: don't show miniconda output on install COMPAT: compat with numpy >= 1.14 on str repr TST: temp disable python-dateutil from master closes pandas-dev#18123 (cherry picked from commit 8dac633)
I think this is a very recent change in numpy in how ndarrays are printed. So we would conditionally change the expected if
not _np_version_under1p14
https://travis-ci.org/pandas-dev/pandas/jobs/297507212
The text was updated successfully, but these errors were encountered: