When summing FixedEffect instances built from a Pandas DataFrame with converted dtypes, the function remove_duplicate_columns in brainstat/stats/terms.py raises the following error:
File ~/GitRepos/BrainStat/brainstat/stats/terms.py:243, in remove_duplicate_columns(df, tol)
241 df *= 1 / tol
242 # keep = df.round().T.drop_duplicates(keep="last").T.columns # Slow!!
--> 243 idx = np.unique(df.round().values, axis=1, return_index=True)[-1]
244 keep = df.columns[sorted(idx)]
245 return keep
TypeError: The axis argument to unique is not supported for dtype object
Please provide the steps to reproduce and if possible a minimal demo of the problem.
When summing
FixedEffect
instances built from a Pandas DataFrame with converted dtypes, the functionremove_duplicate_columns
inbrainstat/stats/terms.py
raises the following error:Here is a MWE:
No crash.
Python
3.9.11
Brainstat0.3.6