Is there a way to set column names for arguments as column index
position, rather than column names?
Every example that I see is written with column names on value_vars
. I need to use the column index.
For instance, instead of:
df2 = pd.melt(df,value_vars=['asset1','asset2'])
Using something similar to:
df2 = pd.melt(df,value_vars=[0,1])
Select columns names by indexing: