Open umangretailio opened 1 year ago
@umangretailio what is the script you ran? Did you click on the dataframe in the variable explorer?
A way to provoke something similar is to run:
import pandas as pd
df = pd.DataFrame([1,2,3], [1,2,3])
df.columns = [{'test': 'x'}]
and then click on the df in the variable explorer. Of course it doesn't like dicts as column names - which is generally a very bad idea.
Still Spyder should handle that case somehow, instead of creating an internal error.
Internally, we run something like:
for x,y in df.items(): print(x,y)
which already produces an error - so we otherwise might just cath the error and provide valuable feedback to the user as the issue is more a pandas thing
Of course one can fix this in max_min_col_update and catch the error and return len(self.df.columns) * [None]
Yet this still has a lot of errors when clicking on a column, typing df
in the IPython (which is a IPython format error) and so on..
So I would disregard using any Dataframes with unhashable column names
Still Spyder should handle that case somehow, instead of creating an internal error.
I agree @maurerle.
Of course one can fix this in max_min_col_update and catch the error and return len(self.df.columns) * [None]
What if we show a QMessabeBox saying that Spyder can't display DataFrames with unhashable column names? I think that would be the best we could do on the Spyder side (of course, there's nothing we can do about the IPython issues you mentioned).
Description
What steps will reproduce the problem?
Traceback
Versions
Dependencies