-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: move/reorg pandas.tools -> pandas.core.reshape #16032
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
Conversation
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.
- The
utils
(to_numeric
) don't really belong inreshape
- Could we, internally, just import from
pandas.core.reshape
? Instead of frompandas.core.reshape.reshape
,pandas.core.reshape.pivot
, ..) Makes the imports somewhat shorter, and also makes it easier to change things within the reshape submodule without having to change all imports
doc/source/conf.py
Outdated
@@ -230,7 +230,7 @@ | |||
# the API pages as top-level functions) based on a template (GH9911) | |||
moved_api_pages = [ | |||
'pandas.core.common.isnull', 'pandas.core.common.notnull', 'pandas.core.reshape.get_dummies', | |||
'pandas.tools.merge.concat', 'pandas.tools.merge.merge', 'pandas.tools.pivot.pivot_table', |
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.
Those shouldn't be changed
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.
so what should these be?
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.
just leave it as is. This is for "back compat" with existing links on the internet, as we previously included the docstring pages for concat using those paths, but now just as pandas.concat
doc/source/whatsnew/v0.20.0.txt
Outdated
@@ -1348,6 +1348,7 @@ If indicated, a deprecation warning will be issued if you reference theses modul | |||
"pandas.parser", "pandas.io.libparsers", "X" | |||
"pandas.formats", "pandas.io.formats", "" | |||
"pandas.sparse", "pandas.core.sparse", "" | |||
"pandas.tools", "pandas.core.tools", "pandas.tools.plotting" |
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.
I don't think this will be clear. I would rather add another new line for the plotting
"pandas.tools.plotting", "pandas.plotting", "X"
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.
yeah we should fix the docs on all this
pandas/core/reshape/merge.py
Outdated
@@ -47,7 +47,7 @@ | |||
def concat_wrap(): | |||
|
|||
def wrapper(*args, **kwargs): | |||
warnings.warn("pandas.tools.merge.concat is deprecated. " |
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 will need to keep this one as well (if we thought it was needed). In any case, deprecating the function at the new location pandas.core.reshape.merge.concat
does not really make sense (no one is using that)
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.
hmm, this was original pandas.tools.merge.concat
; I will put a deprecation there then.
@@ -9,7 +9,8 @@ | |||
|
|||
from pandas.util.testing import assert_frame_equal | |||
|
|||
from pandas.core.reshape import (melt, lreshape, get_dummies, wide_to_long) |
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.
these can actually also be imported just from pandas
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.
sure lots of things like this :>
vb_suite/reshape.py
Outdated
@@ -55,7 +55,7 @@ def unpivot(frame): | |||
# Melt | |||
|
|||
setup = common_setup + """ | |||
from pandas.core.reshape import melt |
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.
I know it was an automatic search replace, but no need to change those (we should actually just remove them)
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.
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.
right
yes this is a bit tricky as I have to elevate the the (all internal) API from the sub-modules to |
Codecov Report
@@ Coverage Diff @@
## master #16032 +/- ##
==========================================
- Coverage 90.99% 90.76% -0.24%
==========================================
Files 153 155 +2
Lines 50469 50470 +1
==========================================
- Hits 45924 45808 -116
- Misses 4545 4662 +117
Continue to review full report at Codecov.
|
xref #13634