I'm getting "Unhashable Type: index" error in python code. Can you please help to resolve this? I'm using python3.
df_temp_cns = pd.read_excel(r"/nsmnt/NS_Exec_DSHBD/IS_IT_Demad_Perf/cns_weekly/SrcFile/JnJ_CNS_Weekly_No_Indication_WE_2019-01-25.xlsx", header=0, skiprows=0)
z = 0
for x in range(0,20): #movies_skip_rows.index:
if z > 24:
break
z = 0
for y in range(0,25):
m = df_temp_cns.iloc[x,y]
if pd.notnull(m):
z = z+1
# Read the pivot table from excel
df_cns = pd.read_excel(r"/nsmnt/NS_Exec_DSHBD/IS_IT_Demad_Perf/cns_weekly/SrcFile/JnJ_CNS_Weekly_No_Indication_WE_2019-01-25.xlsx", header=0, skiprows=x+1)
# De-pivot data and rename columns
df_cns_depivot = pd.melt(df_cns, id_vars=df_cns.columns[0],value_vars=df_cns.columns[1:], value_name="Units")
Below line i'm getting error-
df_cns_depivot = pd.melt(df_cns, id_vars=df_cns.columns[0],value_vars=df_cns.columns[1:], value_name="Units")
0 Answer(s)