Skip to content

Commit

Permalink
Avoid using pd.unique()
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann committed Sep 1, 2023
1 parent b16ae63 commit 652ee27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyam/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,10 @@ def _get_col(c):
except KeyError:
return df[c]

index = list(zip(*[_get_col(col) for col in cols]))
if unique:
index = pd.unique(index)
return pd.MultiIndex.from_tuples(index, names=tuple(cols))
index = pd.MultiIndex.from_tuples(
list(zip(*[_get_col(col) for col in cols])), names=tuple(cols)
)
return index.drop_duplicates() if unique else index


def pattern_match(
Expand Down

0 comments on commit 652ee27

Please sign in to comment.