Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data_new = pd.melt(data.reset_index(), id_vars=['index'], value_vars=['A','B','C'])
- data_new.columns=['index','treatments','value']
- Two-Way ANOVA
- # you do not need to reshape if your data is already in stacked format.
- d_melt = pd.melt(data, id_vars=['Genotype'], value_vars=['1_year', '2_year', '3_year'])
- # replace column names
- d_melt.columns = ['Genotype', 'years', 'value']
- d_melt.head()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement