I'm getting "Unhashable Type : Index" error in python code. i'm using python3 .
Can you please help me to resolve this problem?
code-
<pre>
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):
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
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)
df_cns_depivot = pd.melt(df_cns, id_vars=df_cns.columns[0],value_vars=df_cns.columns[1:], value_name="Units")
I'm getting error in below line-
<pre lang="Python">df_cns_depivot = pd.melt(df_cns, id_vars=df_cns.columns[0],value_vars=df_cns.columns[1:], value_name="Units")
What I have tried:
I tried many thing but didn't resolve this problem.