You're going to want to use the DataFrame.boxplot
method and group by the "Parameter" and "Site" columns.
import matplotlib.pyplot as plt
from pandas import DataFrame
df = DataFrame({'Parameter': ['A',]*8,
'Site': ['S1', 'S2', 'S1', 'S2', 'S1', 'S2', 'S1', 'S2'],
'Value': [2.34, 2.67, 2.56, 2.89, 3.45, 4.45, 3.67, 4.56]})
df.boxplot(by=['Parameter', 'Site'])
plt.show()
If you want to plot a specific column of your data, you can use the column
keyword argument to boxplot
.
# Plot single value
df.boxplot(column='Value', by=['Parameter', 'Site'])
# Plot Multiple values
df.boxplot(column=['Value', 'OtherValue'], by=['Parameter', 'Site'])
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…