-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: Remove pandas.np #30296
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
There is a chance removing this will break something, in case adding it wasn't random, but I believe it should still be removed. It's ugly and the issues that might arise are easily fixable. |
We remove everything gradually, by first raising warnings. I think there are other things we may also want to check if we should remove, I saw a |
Similar but more minor, looks like users will also import
|
Fair point about the deprecation warning.
This works:
This doesn't:
|
The numpy import is actually explicit: Line 108 in 37dfcc1
numpy : Line 3 in 37dfcc1
pandas.np is different from np as it provides a compatability layer between NumPy and pandas. Removing this alias would also wipe out this myth. As it is just an alias, the breaking change is really easy to resolve.
The Line 42 in 37dfcc1
pandas.datetime . There is no usage of it in the __init__.py .
|
For python 3.7+, we can actually deprecate this with the module getattr trick (the same we use for Panel dummy class right now). So I think we can go through a deprecation cycle instead of directly removing (for python 3.6, this is more difficult though). |
Yep, I got confused, it's obviously our own array. |
take |
Are we wanting to do this for 1.0, or should it wait, or does it not matter? |
Would be nice, but I don't think it's important, since it won't be removed until 2.0 I guess. |
|
the private modules don’t show up anyhow so reallly nbd in those we didn’t actually depreciate isnull/notnull |
Can i have a go at datetime or isnull/notnull ? |
I think it is better to first finalize the open PR: #30386. Also, if we want to deprecate isnull/notnull, let's first discuss that in a separate issue, as this is a quite different thing. Here we are discussing shortcuts for external packages. |
ok will wait for this PR to be merged - if datetime still requires treatment in this issue then happy to work on that. |
I think we want to get rid of |
ok will do, thanks @datapythonista |
Hi guys, I've got this code:
Which now gives this warning message:
What do I need to do to avoid that warning? Thanks! :) |
Replace |
Thanks Joris! |
Not sure if it was added intentionally, but it's possible to call numpy with the
np
attribute of the pandas module:While this is not documented, I've seen couple of places suggesting this as a "trick" to avoid importing numpy directly.
I personally find this hacky, and I think should be removed.
The text was updated successfully, but these errors were encountered: