-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
COMPAT: Expand compatibility with fromnumeric.py #12810
Conversation
ok, some comments. |
@@ -105,6 +104,56 @@ API changes | |||
- ``pd.show_versions()`` now includes ``pandas_datareader`` version (:issue:`12740`) | |||
- Provide a proper ``__name__`` and ``__qualname__`` attributes for generic functions (:issue:`12021`) | |||
|
|||
.. _whatsnew_0181.numpy_compatibility | |||
|
|||
Compatibility between pandas array-like methods (e.g. ```sum`` and ``take``) and their analogous |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
say numpy counterparts
, rather than analagous
dont need (generally with *args, and **kwargs
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
f1d02ed
to
365f956
Compare
Do not call this function via the numpy library, as numpy's version | ||
has a completely different purpose (returns number of dimensions in | ||
an array)! | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jreback : How about this warning? Should it be kept, or should it be the user's responsibility to know the two 'rank' functions serve completely different purposes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have a really different signature as pandas rank is much more friendly to different dtypes, you can prob just raise on this one if someone does np.rank(...)
but if you can't it doesn't really matter. again if someone is doing it, then they must know what they are doing, no amount of documentation will help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I think I'll just remove it then. In worst case, if a user tries to call via the numpy
library we can say that, "look, the documentation is different".
fb61e17
to
b809c2a
Compare
I hate to be a curmudgeon on this issue, but how do we benefit from increasing our API coupling to NumPy? We've been discussing moving precisely in the opposite direction. |
b809c2a
to
199af28
Compare
427a54b
to
10fb3ae
Compare
I've made all of the necessary changes (for ones I didn't make I provided reason(s) for not doing so), and Travis is still passing. Codecov is doing something strange as it is with my |
|
||
data[5] = np.nan | ||
out = np.cumsum(SparseArray(data, fill_value=2)) | ||
self.assertNotIsInstance(out, SparseArray) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same reference here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same response as above
@gfyoung ok just a couple minor comments. pls rebase and lmk when green. also your numpy side-pr won't cause any issues (as it will be merged to numpy after this)? |
ok, I think this looks good. give a nice update / rebase and force push. ping when green. |
10fb3ae
to
afeaff1
Compare
Augment pandas array-like methods with appropriate parameters (generally, '*args' and '**kwargs') so that they can be called via analogous functions in the numpy library they are defined in 'fromnumeric.py'. Closes pandas-devgh-12638. Closes pandas-devgh-12644. Closes pandas-devgh-12687.
afeaff1
to
429bc51
Compare
@jreback : Travis is giving the green light. Ready to merge if there is nothing else. |
thanks @gfyoung that was beast-like ! |
Sure thing. 😄 |
Follow-on to #12810 by expanding compatibility with fromnumeric.py in the following modules: 1) tslib.pyx 2) window.py 3) groupby.py and resample.py (shared classes) Closes #12811. Author: gfyoung <gfyoung17@gmail.com> Closes #13148 from gfyoung/fromnumeric-compat-continued and squashes the following commits: eb4762c [gfyoung] COMPAT: Expand compatibility with fromnumeric.py
Please pull this solution to main library of pandas because still this problem is not solved... |
@hemangjoshi37a this changeset is already included in the main pandas library since the 0.18.1 release. If you still have a problem related to this, please open a new issue with a reproducible example. |
ok...
…On Tue, 26 Jun 2018 at 15:04, Joris Van den Bossche < ***@***.***> wrote:
@hemangjoshi37a <https://github.com/hemangjoshi37a> this changeset is
already included in the main pandas library since the 0.18.1 release. If
you still have a problem related to this, please open a new issue with a
reproducible example.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12810 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL0XmTt9iAb5f_7VOVbrAQubCyvcj9_kks5uAgA1gaJpZM4IA_aM>
.
--
Regards,
Hemang Joshi,
Email : hemangjoshi37a@gmail.com
mobile : +919409077371
|
Fixes up OR addresses what are AFAICT almost if not all of the incompatibilities
pandas
currently has withnumpy.core.fromnumeric
. My goodness, were there a lot of them.Closes #12638.
Closes #12644.
Closes #12687.