Skip to content

Commit

Permalink
Merge pull request #293 from NicolasGensollen/fix-TypeError
Browse files Browse the repository at this point in the history
[FIX] Fix `TypeError` in `remove_duplicate_columns`
  • Loading branch information
zihuaihuai authored Sep 26, 2024
2 parents 34239aa + 85ca0f4 commit c3280d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion brainstat/stats/terms.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def remove_duplicate_columns(df: pd.DataFrame, tol: float = 1e-8) -> List[str]:
df = df / df.abs().sum(0)
df *= 1 / tol
# keep = df.round().T.drop_duplicates(keep="last").T.columns # Slow!!
idx = np.unique(df.round().values, axis=1, return_index=True)[-1]
idx = np.unique(df.round().to_numpy(dtype=float), axis=1, return_index=True)[-1]
keep = df.columns[sorted(idx)]
return keep

Expand Down

0 comments on commit c3280d2

Please sign in to comment.