Pretty new to stackoverflow, please bear with me if the format looks odd..
I have a big set of data with 100+ columns of data structured like:
countrya countryb year variable1 variable2 ...... varaible100
I want to have the 100 variables separated into 100 new dataframes and save them into csvs.
Below is the code I have for creating 1 new csv.
dfm1=pd.melt(df, id_vars=['countrya','countryb','year'], value_vars=['variable1'],
value_name='variable1')
dfm1.drop('variable',axis=1)
dfm1.to_csv('newdf1.csv')
How can I automate the process? Thank you!