Мне нужен код предупреждения о предсказании для значения процессора в python. Мне нужно проверить, чтобы продолжать увеличивать значение процессора в зависимости от времени запуска. Условие предварительного предупреждения: 0–30 = зеленый, 30–50 = желтый, 50–70 = красный сигнал. фактическое состояние тревоги> 80> ?. У нас 6 серверов. Мне также нужно сначала отсортировать.
пример данных:
df_cpu_2_copy[["date","server","timestamp","time","cpu","cpu2","cpu3"]]
Out[31]:
date server timestamp time cpu cpu2 cpu3
0 2019-07-15 NaN 1563190205 11:30:05 0.2 NaN False
1 2019-07-15 NaN 1563197405 13:30:05 0.2 0.2 False
2 2019-07-15 NaN 1563175805 07:30:05 0.5 0.2 True
3 2019-07-15 NaN 1563183005 09:30:05 0.8 0.5 True
4 2019-07-15 NaN 1563196204 13:10:04 0.8 0.8 False
5 2019-07-15 NaN 1563172205 06:30:05 1.5 0.8 True
6 2019-07-15 NaN 1563198484 13:48:04 1.5 1.5 False
7 2019-07-15 NaN 1563201004 14:30:04 1.8 1.5 True
8 2019-07-15 NaN 1563186605 10:30:05 2.2 1.8 True
9 2019-07-15 NaN 1563179404 08:30:04 2.9 2.2 True
10 2019-07-15 NaN 1563198605 13:50:05 3.0 2.9 True
11 2019-07-15 NaN 1563198125 13:42:05 3.8 3.0 True
12 2019-07-15 NaN 1563165004 04:30:04 4.0 3.8 True
13 2019-07-15 NaN 1563175805 07:30:05 4.0 4.0 False
14 2019-07-15 NaN 1563174605 07:10:05 4.2 4.0 True
15 2019-07-15 NaN 1563198244 13:44:04 4.5 4.2 True
16 2019-07-15 NaN 1563198365 13:46:05 5.1 4.5 True
17 2019-07-15 NaN 1563196085 13:08:05 5.2 5.1 True
18 2019-07-15 NaN 1563193805 12:30:05 5.4 5.2 True
19 2019-07-15 NaN 1563201004 14:30:04 6.2 5.4 True
20 2019-07-15 NaN 1563186605 10:30:05 7.4 6.2 True
21 2019-07-15 NaN 1563195484 12:58:04 7.6 7.4 True
22 2019-07-15 NaN 1563198305 13:45:05 8.1 7.6 True
23 2019-07-15 NaN 1563199204 14:00:04 8.5 8.1 True
24 2019-07-15 NaN 1563170405 06:00:05 8.9 8.5 True
25 2019-07-15 NaN 1563198664 13:51:04 8.9 8.9 False
26 2019-07-15 NaN 1563198425 13:47:05 9.2 8.9 True
27 2019-07-15 NaN 1563198185 13:43:05 9.5 9.2 True
28 2019-07-15 NaN 1563179404 08:30:04 9.6 9.5 True
29 2019-07-15 NaN 1563198725 13:52:05 9.6 9.6 False
... ... ... ... ... ... ...
8604 2019-07-14 NaN 1563141905 22:05:05 98.4 98.4 False
8605 2019-07-14 NaN 1563148684 23:58:04 98.4 98.4 False
8606 2019-07-14 NaN 1563144125 22:42:05 98.5 98.4 True
8607 2019-07-14 NaN 1563144544 22:49:04 98.5 98.5 False
8608 2019-07-14 NaN 1563145144 22:59:04 98.5 98.5 False
8609 2019-07-14 NaN 1563145984 23:13:04 98.5 98.5 False
8610 2019-07-14 NaN 1563146585 23:23:05 98.5 98.5 False
8611 2019-07-15 NaN 1563153965 01:26:05 98.5 98.5 False
8612 2019-07-14 NaN 1563141664 22:01:04 98.5 98.5 False
8613 2019-07-14 NaN 1563143644 22:34:04 98.5 98.5 False
8614 2019-07-14 NaN 1563143824 22:37:04 98.5 98.5 False
8615 2019-07-14 NaN 1563146524 23:22:04 98.5 98.5 False
8616 2019-07-14 NaN 1563142085 22:08:05 98.5 98.5 False
8617 2019-07-14 NaN 1563139024 21:17:04 98.6 98.5 True
8618 2019-07-14 NaN 1563142384 22:13:04 98.6 98.6 False
8619 2019-07-14 NaN 1563143164 22:26:04 98.6 98.6 False
8620 2019-07-14 NaN 1563145324 23:02:04 98.6 98.6 False
8621 2019-07-14 NaN 1563146344 23:19:04 98.6 98.6 False
8622 2019-07-14 NaN 1563146524 23:22:04 98.6 98.6 False
8623 2019-07-14 NaN 1563146884 23:28:04 98.6 98.6 False
8624 2019-07-14 NaN 1563141664 22:01:04 98.7 98.6 True
8625 2019-07-14 NaN 1563141904 22:05:04 98.7 98.7 False
8626 2019-07-14 NaN 1563142264 22:11:04 98.7 98.7 False
8627 2019-07-14 NaN 1563143345 22:29:05 98.7 98.7 False
8628 2019-07-14 NaN 1563143825 22:37:05 98.7 98.7 False
8629 2019-07-14 NaN 1563148324 23:52:04 98.7 98.7 False
8630 2019-07-14 NaN 1563144905 22:55:05 98.8 98.7 True
8631 2019-07-14 NaN 1563148744 23:59:04 99.0 98.8 True
8632 2019-07-14 NaN 1563144364 22:46:04 99.0 99.0 False
8633 2019-07-14 NaN 1563148445 23:54:05 99.1 99.0 True
[8634 rows x 7 columns]