-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathenvs_plot_data.py
More file actions
28 lines (22 loc) · 1.04 KB
/
envs_plot_data.py
File metadata and controls
28 lines (22 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('growth_phases_data/full_data.csv', sep=',', decimal=',')
colors = ['r', 'g', 'b', 'm', 'y', 'pink']
for col in df.columns:
vals = []
if col not in ['Эксперимент', 'Сутки']:
for i in range(1, 6):
sub_df = df[df['Эксперимент']==i]
sub_df = sub_df.drop(columns=['Эксперимент'])
norm_data = sub_df[col]
plt.scatter(sub_df['Сутки'], norm_data, s=2, c=colors[i])
daily_df_mean = sub_df.groupby('Сутки').mean()
daily_df_max = sub_df.groupby('Сутки').max()
daily_df_min = sub_df.groupby('Сутки').min()
daily_data = daily_df_mean[col]
plt.plot(daily_data.index, daily_data, c=colors[i], label=f'Exp {i}')
plt.fill_between(daily_data.index, daily_df_min[col], daily_df_max[col], alpha=0.3, color=colors[i])
plt.title(col)
plt.legend()
plt.xlabel('Сутки')
plt.show()