How do I include many columns in pd.melt function instead of just typing each and everyone out?
sample output
month
m1
m2
m3
...
m12
here is the answer i come up with using iloc!
sorry for asking a easy question that I can figure out myself
pd.melt(.......value_vars=billboard.iloc[-12:])
I have a data set that has the following columns. funciton: pd.melt()
years name date m1 m2 m3 m4 m5 m6 …. to m12
I set me variable name to month and try to include m1-m12, but I just cant get it to work. it will instead put everything in the new week column which looks like
week
year
name
date
m1
m2
I don't want the week year name date, is there a way to just put m1-m12 in like indexing? i have tried it it didn't work