Skip to content

Commit

Permalink
re- Minor optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
yohplala committed Sep 2, 2024
1 parent f8f33bf commit 2c530a2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions oups/store/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,9 @@ def conform_cmidx(df: DataFrame):
"""
# If a name is 'None', set it to '' instead.
cmidx = df.columns
level_updated_idx = []
if None in cmidx.names:
level_updated_idx = [i for i, name in enumerate(cmidx.names) if name is None]
cmidx.set_names([""] * len(level_updated_idx), level=level_updated_idx, inplace=True)
cmidx.set_names([""] * len(level_updated_idx), level=level_updated_idx, inplace=True)
# If an item of the column name is not a string, turn it into a string.
# Using 'set_levels()' instead of rconstructing a MultiIndex to preserve
# index names directly.
Expand Down

0 comments on commit 2c530a2

Please sign in to comment.