I am working on a dataframe with multivariables; I used the pivot table function to rapidly calculate the mean values for every group and created another table that has the very same index but displays the standard error (sem).
I wanted to create a line plot with the error bars but I am stacked here, I don’t have much experience with this kind of tables unfortunately.
Thank you for any support
df = pd.read_excel('Arabidopsis.xlsx')
df.head()
[this is the dataframe](https://i.sstatic.net/jGtYvoFd.png)
df_pivot = df.pivot_table(index='PAR', columns=['Salinity','Accession'], values=['ETR'], aggfunc=['mean'])
df_pivot
[This is the pivot table with mean values](https://i.sstatic.net/6a2rydBM.png)
df_pivot_sem = df.pivot_table(index='PAR', columns=['Salinity','Accession'], values=['ETR'], aggfunc=['std'])/16
df_pivot_sem
[This is the pivot table with standard error values](https://i.sstatic.net/IpclJpWk.png)
New contributor
davide giordano is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.