-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Numpy 1.8 DeprecationWarning
in compat/scipy.py
#5824
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
can you show what |
Can repro this with plain numpy as:
|
ahh...i see you are trying to index with floats as the indexer (when its convertible to an int)....its 'accepted'...but in general not a good idea. I am going to warn on this in 0.14 too, see here:http://pandas.pydata.org/pandas-docs/dev/whatsnew.html#float64index-api-change (the very last part). |
I think pandas is generating the float index internally in compat/scipy.py. If I call |
if you have your above example (the top example) fail, can you print out those values (they should be the |
Here are the values again for the original example: Looks to me like pandas has an old version of scipy |
idx is computed by scipy |
I didn't have scipy installed when I the fail, so I think that Looks like scipy.stats.scoreatpercentile was last changed in commit |
for reference: |
ahh...I see now... ok...so basically that module then needs updating.... care to submit a PR (and prob need some tests their) we have a 'soft' dep on scipy...but this is such a common thing its fine to have it 'built' in so will call this a 'bug' then |
Sure, I will draft a pr
|
note that (still unreleased) numpy 1.9 will have a percentile that should be able to replace scipy.scoreatpercentile both in performance and features. |
@gdraps could you submit a PR for this? (and for numpy 1.9 should take advantage of the changes).... |
@gdraps PR for this? |
Sent PR #6740 to fix the core issue, though it doesn't take advantage of numpy.percentile, which has been in numpy in a form that appears compatible with pandas's usage since 1.5, best I can tell. When I tried to simply replace
|
the way the fractions are computed are not the same in your function and numpy so you get slight rounding errors, numpy computes:
while your code has one operation less:
maybe we could change numpy to that method if you expect it causes issues, but relying on exact results for floating point operations is usually not a good idea in high level programs without tight control on the operations and rounding modes |
@gdraps I would be happy just dropping entirely Not sure why this was not done originally. Pls also add a test for using |
re:
Is the intended behavior for
|
hmm..it should, but I suspect its not being inferred at all (IIRC I had to put it in manually for timedeltas, so prob need a check for similar for datetimes). want to add that and a test or 2? (and add a separate release note for that change as well) |
Yup. Can add that later today.
|
Not sure how pressing this is, but with
DeprecationWarning
enabled, I notice that numpy 1.8 is raising a warning during the following call todescribe()
. [side note: enabled DeprecationWarning in my test suite after learning that it was changed in py2.7 to "ignore" by default.]stdout:
Here's the full traceback with DeprecationWarning escalated to an error (
warnings.simplefilter("error", DeprecationWarning)
):The text was updated successfully, but these errors were encountered: