-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Infer names in MultiIndex.from_product #27895
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
Infer names in MultiIndex.from_product #27895
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.
Thanks! A few comments but looks good overall.
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.
To disable this, I now have to do
from_product(iterables, names=[None] * len(iterables)
Are we OK with that? Or do we want to allow names=None
to continue to mean no names? If so, we'll need a different sentinel value that None (no_default = object()
)
doc/source/whatsnew/v1.0.0.rst
Outdated
@@ -31,7 +31,7 @@ Other enhancements | |||
|
|||
.. _whatsnew_1000.api_breaking: | |||
|
|||
- | |||
- :meth:`MultiIndex.from_product` infers level names from inputs if possible (:issue:`27292`) |
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.
But this above the .. _whatsnew_1000.api_breaking:
line.
And maybe say "when not explicitly provided" rather than "if possible".
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.
Put this above the
.. _whatsnew_1000.api_breaking:
line.
It looks like a few of the section reference names are slightly misaligned with ticks throughout the whatsnew:
Enhancements
~~~~~~~~~~~~
.. _whatsnew_1000.enhancements.other:
-
-
Other enhancements
^^^^^^^^^^^^^^^^^^
.. _whatsnew_1000.api_breaking:
-
-
Backwards incompatible API changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. _whatsnew_1000.api.other:
- :class:`pandas.core.groupby.GroupBy.transform` now raises on invalid operation names (:issue:`27489`).
I'll open up a quick PR to fix it across the board. Might result in a merge conflict here but should be straightforward to resolve.
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 made the change to the text in whatsnew, holding off on changing anything else if jschendel is going to be changing other parts of the file.
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 just merged my changes to the whatsnew, so you should be good to make the additional changes now. Should just need to address the merge conflict by making sure your entry is above the .. _whatsnew_1000.api_breaking:
line.
@TomAugspurger in regards to your first comment, the reason I opened an issue about this in the first place was due to the addition of |
you would also have to change |
@christopherzimmerman do you have time to make The default value will be something like
|
@TomAugspurger sorry for the inactivity, I'll make those changes. I believe I messed up the commit history for this PR when I rebased from master (which is resulting in a check failing), and have a lot of junk commits included, I may close this PR and open another one. |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff