Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upDEPR: Remove pandas.np #30296
DEPR: Remove pandas.np #30296
Comments
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
Similar but more minor, looks like users will also import
|
This comment has been minimized.
This comment has been minimized.
|
Fair point about the deprecation warning.
This works:
This doesn't:
|
This comment has been minimized.
This comment has been minimized.
|
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.
|
This comment has been minimized.
This comment has been minimized.
|
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). |
This comment has been minimized.
This comment has been minimized.
Yep, I got confused, it's obviously our own array. |
This comment has been minimized.
This comment has been minimized.
|
take |
This comment has been minimized.
This comment has been minimized.
|
Are we wanting to do this for 1.0, or should it wait, or does it not matter? |
This comment has been minimized.
This comment has been minimized.
|
Would be nice, but I don't think it's important, since it won't be removed until 2.0 I guess. |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
the private modules don’t show up anyhow so reallly nbd in those we didn’t actually depreciate isnull/notnull |
This comment has been minimized.
This comment has been minimized.
|
Can i have a go at datetime or isnull/notnull ? |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
ok will wait for this PR to be merged - if datetime still requires treatment in this issue then happy to work on that. |
This comment has been minimized.
This comment has been minimized.
|
I think we want to get rid of |
This comment has been minimized.
This comment has been minimized.
|
ok will do, thanks @datapythonista |
Not sure if it was added intentionally, but it's possible to call numpy with the
npattribute 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.