8000 BUG: #19497 FIX. Add tupleize_cols option to internals._transform_index() by charlie0389 · Pull Request #20526 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: #19497 FIX. Add tupleize_cols option to internals._transform_index() #20526

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Formatting changes to pass flake8 tests.
  • Loading branch information
charlie0389 committed Mar 29, 2018
commit f79b82d26c55aab92161656c2ca8ec35f02e2b17
6 changes: 4 additions & 2 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,8 +971,10 @@ def f(x):
baxis = self._get_block_manager_axis(axis)
if level is not None:
level = self.axes[axis]._get_level_number(level)
result._data = result._data.rename_axis(f, axis=baxis, copy=copy,
level=level, tupleize_cols=tupleize_cols)
result._data = \
result._data.rename_axis(f, axis=baxis, copy=copy,
level=level,
tupleize_cols=tupleize_cols)
result._clear_item_cache()

if inplace:
Expand Down
3 changes: 2 additions & 1 deletion pandas/core/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3294,7 +3294,8 @@ def rename_axis(self, mapper, axis, copy=True, level=None,

"""
obj = self.copy(deep=copy)
obj.set_axis(axis, _transform_index(self.axes[axis], mapper, level, tupleize_cols=tupleize_cols))
obj.set_axis(axis, _transform_index(self.axes[axis], mapper, level,
tupleize_cols=tupleize_cols))
return obj

def add_prefix(self, prefix):
Expand Down
0