Data Snippet
i want to reshape the dataframe and make the columns what i’m highlighting with red circles
when i print first row , columns of data frame respectively
with open(filename, 'wb') as f:
f.write(response.content)
df = pd.read_csv(filename)
df.stack(0).swaplevel(0,1).sort_index()
print(df.iloc[0])
print(df.columns)
New contributor
Jimmy Ross is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.