-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
nanmin no longer works with series #8383
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
its a numpy issue I think. It doesn't respect an array-like but non-ndarray subclass. You can use |
you should always post the versions of python/pandas/numpy you are using FYI closing as a numpy issue |
cross posted as numpy/numpy#5114 I would argue that this is a pandas issue as it was changes on this side that broke things, not changes on the numpy side. |
@tacaswell disagree, if This has to do with how numpy is or IS NOT following ndarray-like objects, e.g. calling (or not) |
I reported the same issue to numpy and the immediate response was that it is likely a pandas issue. On Sep 24, 2014, at 3:14 PM, jreback <[email protected]mailto:[email protected]> wrote: you should always post the versions of python/pandas/numpy you are using FYI closing as a numpy issue — |
@rstoneback I know, read my comments. It is a numpy abusing the API issue. We didnt' change anything. They added the function and it has a different behavior/API than other functions. In any event, you should simply use |
My last comment about reporting the issue to numpy didn't post for some time (I replied to github email). I've switched to using the pandas functions. |
Using the series min function works great. Thanks for the quick responses. Cheers. |
s = pd.Series(range(10))
np.nanmin(s) In the above example, http://nbviewer.ipython.org/gist/dalejung/56b73c3cfd71b02ec414 also an |
you can try changing array_wrap to not wrap scalars |
Yeah, I'm gonna see about not wrapping scalars. Want to poke around and figure out the history on why |
@dalejung if you think best soln here is to simply add |
actually, will reopen and leave for 0.15.1 |
@jreback When you say |
numpy does this check on array-likes, something like:
(and nanmin does this too) |
@jreback check out http://nbviewer.ipython.org/gist/dalejung/1c378f7d2b149e2f3a40 I don't think that behavior is uniform, or at least I'm not sure where in the |
yeh it might that their implementation is messed up too. I don't understand why they do it for |
@dalejung you might be able to intercept in (the return values) |
@jreback yeah I agree. If we could've opted out of the either way, the |
This is possibly related to the keepdims kwarg (numpy/numpy#4619). Don't have time right now to run down if it is actually related, just dropping bread crumbs. |
@tacaswell maybe you can explain why I conceptually get it, looking more for what problem does this solve in numpy (e.g. why was it added). I guess this might boil down to sub-class vs ndarray-like ? |
This issue has been solved: >>> np.nanmin(pds.Series([1,2,3,4]))
1 I'm on numpy 1.13.1 and pandas 0.22. |
yup. though its possibly only for certainly versions of numpy. @topper-123 can you add some tests and see? |
This is solved only for numpy >= 1.13. Where would tests for this be placed? |
test_nanops |
Using NumPy's nanmin on a pandas Series worked as expected, now however the Series is returned with each element set to the minimum, rather than just getting the minimum. Not sure if this is a Numpy of Pandas issue.
The text was updated successfully, but these errors were encountered: