-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Rewrite _make_concat_multiindex #25117
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
Hello @toobaz! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on February 03, 2019 at 15:53 Hours UTC |
7d6d8f9
to
c9898c1
Compare
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.
small comments. otherwise nice cleaning.
@@ -183,6 +183,7 @@ Reshaping | |||
|
|||
- Bug in :func:`merge` when merging by index name would sometimes result in an incorrectly numbered index (:issue:`24212`) | |||
- :func:`to_records` now accepts dtypes to its `column_dtypes` parameter (:issue:`24895`) | |||
- Bug in :func:`concat` creating a malformed :class:`MultiIndex` when passed multiple frames indexed by identical :class:`MultiIndex`es (:issue:`20565`) |
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.
you need a space before the es I think
tupleize_cols=True) | ||
tot_df = concat([keys_levs.to_frame().reset_index(drop=True), | ||
orig.to_frame().reset_index(drop=True)], axis=1) | ||
temp_names = [None] * keys_levs.nlevels + list(orig.names) |
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.
name this empty_ames
# Received names for all levels | ||
result.names = names | ||
|
||
if levels is not None: |
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.
can you add some commentary what you are doing here
orig = _concat_indexes(indexes) | ||
|
||
# Simplest way to create and prepend the keys level(s): | ||
keys_chunks = [([key] * len(idx)) for (key, idx) in zip(keys, indexes)] |
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.
Maybe make this a generator comprehension instead
closing as stale |
git diff upstream/master -u -- "*.py" | flake8 --diff