Вы можете использовать plotly.express
или plotly.graph_objects
.
Чтение данных:
import pandas as pd
df = pd.read_csv(r'Documents\test.csv', sep=',')
print(df)
print(df.to_dict())
p=0; t=0 p=1; t=6" p=1; t=30" p=3; t=6" p=3; t=30" p=3; t=1'
0 0 3 3 2 10 10
1 2 3 5 4 9 9
2 2 6 1 1 10 9
3 1 1 4 2 7 8
{'p=0; t=0': {0: 0, 1: 2, 2: 2, 3: 1}, 'p=1; t=6"': {0: 3, 1: 3, 2: 6, 3: 1},
'p=1; t=30"': {0: 3, 1: 5, 2: 1, 3: 4}, 'p=3; t=6"': {0: 2, 1: 4, 2: 1, 3: 2},
'p=3; t=30"': {0: 10, 1: 9, 2: 10, 3: 7}, "p=3; t=1'": {0: 10, 1: 9, 2: 9, 3: 8}}
plotly.graph_objects
:
import plotly.graph_objects as go
fig = go.Figure()
for col in df:
fig.add_trace(go.Box(y=df[col].values, name=df[col].name))
fig.show()
plotly.express
:
import plotly.express as px
fig = px.box(pd.melt(df), x="variable", y="value", points="outliers")
fig.show()