Skip to content
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

TypeError: unhashable type: 'numpy.ndarray' #52

Closed
shanto268 opened this issue Oct 23, 2020 · 1 comment
Closed

TypeError: unhashable type: 'numpy.ndarray' #52

shanto268 opened this issue Oct 23, 2020 · 1 comment

Comments

@shanto268
Copy link

Hi guys,

I was trying to use pandasgui to show a DataFrame stored in feather format (access the file from here - https://github.com/shanto268/HEP_DAQ/blob/master/CrateAnalysis/processed_data/events_data_frame_800.ftr ) and ran into the following error message, not entirely sure how to resolve this.

Traceback (most recent call last):
  File "gui_ana.py", line 44, in <module>
    mdfo.gui()
  File "/Users/sshanto/hep/hep_daq/CAMAC/CrateAnalysis/MuonDataFrame.py", line 259, in gui
    show(self.events_df, settings={'block': True})
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandasgui/gui.py", line 264, in show
    pandas_gui = PandasGui(settings=settings, **kwargs)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandasgui/gui.py", line 58, in __init__
    self.store.add_dataframe(df, df_name)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandasgui/store.py", line 245, in add_dataframe
    pgdf.dataframe_explorer = DataFrameExplorer(pgdf)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandasgui/widgets/dataframe_explorer.py", line 40, in __init__
    self.statistics_tab = self.make_statistics_tab(pgdf)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandasgui/widgets/dataframe_explorer.py", line 87, in make_statistics_tab
    "N Unique": pgdf.dataframe.nunique(),
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 8730, in nunique
    return self.apply(Series.nunique, axis=axis, dropna=dropna)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 7547, in apply
    return op.get_result()
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 180, in get_result
    return self.apply_standard()
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 255, in apply_standard
    results, res_index = self.apply_series_generator()
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 284, in apply_series_generator
    results[i] = self.f(v)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 109, in f
    return func(x, *args, **kwds)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/base.py", line 1303, in nunique
    uniqs = self.unique()
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/series.py", line 1868, in unique
    result = super().unique()
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/base.py", line 1265, in unique
    result = unique1d(values)
  File "/Users/sshanto/anaconda3/lib/python3.8/site-packages/pandas/core/algorithms.py", line 389, in unique
    uniques = table.unique(values)
  File "pandas/_libs/hashtable_class_helper.pxi", line 1840, in pandas._libs.hashtable.PyObjectHashTable.unique
  File "pandas/_libs/hashtable_class_helper.pxi", line 1787, in pandas._libs.hashtable.PyObjectHashTable._unique
TypeError: unhashable type: 'numpy.ndarray'
@adamerose
Copy link
Owner

Looks like this is a duplicate of #35 which I thought I fixed but actually didn't. Should be fixed now if you want to test the latest commit pip install git+https://github.com/adamerose/pandasgui.git

Btw your data link is dead, checked out the repo and don't see a 'processed_data' folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants