Dec-24-2020, 08:41 PM
I've been having trouble in a few instances with what I think is the same core issue--I just can't identify exactly what it is.
TypeError: 'DataFrame' objects are mutable, thus they cannot be hashed
Can someone please explain that?
markets = ['ES', 'GC', 'CL', 'EC', 'US'] margin_dict = {} for market in markets: df_name = market market = pd.read_csv(r'C:\Users\Mark17\{}(daily).csv'.format(market), parse_dates=["Date"], index_col="Date") margin_dict[df_name] = market.iloc[:,0].max() * 0.15 * trade_unit[df_name] * multiplier[df_name]This works. However, if I use "market" in place of "df_name" in the last line, then I get:
TypeError: 'DataFrame' objects are mutable, thus they cannot be hashed
Can someone please explain that?