#라운드별 순위 승무패 비교
import pandas as pd
## 1 -> normal / draw -> 0 / exp -> -1 / same -> -2
df = pd.DataFrame({
"Round":[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,29,30,31,
32,33,34,35,36,37,38],
"맨시티":[-2, 1, 0, -1, 0, 1, 0, 1, 1, 1, 0, 0, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1],
"맨유":[-2, -1, 1, -1, 0, 1, -1, 1, -1, -1, 0, 1, 1, 0, 1, 1, 1, 0, -1, 0, 1, 0, 0, 1, 0,
-1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1],
"리버풀":[-1, -1, -1, 0, 1, 1, 0, -1, 0, 1, 0, -1, 1, 0, 0, -1, -1, 0, 1, 1, -1, 1, 1, -1,
1, -1, 1, 1, 1, 1, 0, 0, -1, 1, 1, 1, 1],
"첼시":[-1, 0, -1, 0, 0, 1, 1, 1, 0, 1, -1, -1, 1, -1, 0, 1, 1, 1, 0, 1, -1, 1, 1, 0, 0,
1, 0, 1, -1, 1, 0, 1, 1, -1, -1, -1, -1],
"레스터":[1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, 0, 0, 1, 1, 1, 0, -1, 1, 0, 1, 1,
-1, 1, 1, 0, 1, -1, 1, 1, 0, -1, -1, -1, -1],
"웨스트햄":[1, -1, -1, 0, 0, 1, 1, 1, -1, -1, 1, 0, 1, 0, 0, -1, 1, 1, 1, 1, 1, 0, 1, 1,
1, 1, 1, 0, 1, -1, -1, 1, 1, -1, 0, 1, 1],
"토트넘":[-1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, -1, -1, 0, 0, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1,
1, -1, 1, 0, 1, 0, 1, 1, -1, 1, -1, -1],
"아스널":[1, -1, 1, -1, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 1, 0, 1, -1, 0, -1, 1, -1, 1,
-1, 0, -1, 0, 1, 1, 0, 1, 1, 1, -1,1, 1],
"리즈":[1, 1, 0, -1, -1, 1, -1, 0, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1,
1, 1, 0, 1, 1, -1, 0, 0, -1, -1, 1,1, 1],
"에버턴":[1, 1, 1, 0, -1, -1, -1, 1, -1, 0, -1, -1, 1, 1, -1, -1, 1, 0, 0, -1, 1, 0, -1,
-1, 1, 1, -1, 1, 0, 0, 0, 1, -1, -1,-1, 1, 1],
"아스톤빌라":[-2, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 0, 1, 1, 0, 1, 1, 0, -1, 1, 1, 1, 0,
1, 1, 0, 0, -1, 1, 1, 1, 0, -1, 1,-1, -1, -1],
"뉴캐슬":[-1, 0, 1, -1, 0, -1, 1, 1, -1, 1, 1, -1, 0, 1, 0, 1, -1, 1, 1, -1, 1, -1, 1, 1,
0, 0, 0, 1, 0, -1, -1, 0, 1, -1,1, 1, 1],
"울버햄튼":[-2, -1, 1, -1, 0, -1, 1, 0, 1, 1, 1, -1, -1, 0, 1, 0, 1, -1, 0, -1, -1, 0,
-1, -1, 0, 0, 1, 1, 1, 1, 1, -1, 0,1, 1, 1, 1],
"크팰":[-2, 1, -1, 0, 1, -1, -1, -1, -1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, -1, 1, 1, -1, 1,
0, 1, 1, 0, 0, 1, -1, 1, 1, 1,-1, 1, 1],
"소튼":[-1, -1, 1, 0, -1, -1, 1, 0, -1, 1, 1, 0, -1, 0, 0, -1, -1, 1, -1, 1, 1, -1,
-1, 0, 1, 1, -1, 1, 1, -1, -1, 1, 0,1, 1, 1, 1],
"브라이튼":[-1, -1, 1, 0, 0, 1, 0, -1, 0, 1, 1, 0, 0, 0, 1, 0, 1, -1, 0, -1, -1, 0, 0,
1, -1, 1, -1, 1, 1, 0, 0, -1, -1,1, 0, -1, 1],
"번리":[1, -1, 1, 0, 1, 1, 0, -1, 1, 0, -1, 0, -1, 1, 1, 0, -1, 1, -1, 1, 1, 0, -1, 0,
1, 0, -1, 0, 1, -1, 1, -1, 1,1, 1, 1, -1],
"풀럼":[1, 1, 1, 0, 1, -1, 1, 1, -1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, -1, 1, 0,
-1, 1, 1, 1, 1, 0, 1, 1, 1, 1,0, 1],
"웨브":[1, 0, 1, 0, 0, -1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, -1, 1, 0, -1, 1, 0, 0, -1,
0, 1, 1, -1, -1, 1, 0, 0, 1, 1, 1, 1],
"셰필드":[-2, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, -1, 1, -1, 1, -1, 1, 1, 1,
1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, -1]
})
df
Round | 맨시티 | 맨유 | 리버풀 | 첼시 | 레스터 | 웨스트햄 | 토트넘 | 아스널 | 리즈 | ... | 아스톤빌라 | 뉴캐슬 | 울버햄튼 | 크팰 | 소튼 | 브라이튼 | 번리 | 풀럼 | 웨브 | 셰필드 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 2 | -2 | -2 | -1 | -1 | 1 | 1 | -1 | 1 | 1 | ... | -2 | -1 | -2 | -2 | -1 | -1 | 1 | 1 | 1 | -2 |
1 | 3 | 1 | -1 | -1 | 0 | 1 | -1 | 0 | -1 | 1 | ... | 1 | 0 | -1 | 1 | -1 | -1 | -1 | 1 | 0 | 1 |
2 | 4 | 0 | 1 | -1 | -1 | -1 | -1 | 1 | 1 | 0 | ... | -1 | 1 | 1 | -1 | 1 | 1 | 1 | 1 | 1 | 1 |
3 | 5 | -1 | -1 | 0 | 0 | 1 | 0 | 0 | -1 | -1 | ... | 1 | -1 | -1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4 | 6 | 0 | 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1 | 1 |
16 | 18 | 1 | 1 | -1 | 1 | 1 | 1 | 1 | 0 | -1 | ... | 1 | -1 | 1 | 0 | -1 | 1 | -1 | 1 | 1 | -1 |
17 | 19 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | -1 | ... | 0 | 1 | -1 | 1 | 1 | -1 | 1 | 1 | -1 | 1 |
18 | 20 | 1 | -1 | 1 | 0 | 0 | 1 | 1 | -1 | 1 | ... | -1 | 1 | 0 | 1 | -1 | 0 | -1 | 0 | 1 | -1 |
19 | 21 | 1 | 0 | 1 | 1 | -1 | 1 | -1 | 0 | -1 | ... | 1 | -1 | -1 | -1 | 1 | -1 | 1 | 0 | 0 | 1 |
20 | 22 | 1 | 1 | -1 | -1 | 1 | 1 | -1 | -1 | 1 | ... | 1 | 1 | -1 | 1 | 1 | -1 | 1 | 1 | -1 | -1 |
21 | 23 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | ... | 1 | -1 | 0 | 1 | -1 | 0 | 0 | 0 | 1 | 1 |
22 | 24 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | -1 | -1 | ... | 0 | 1 | -1 | -1 | -1 | 0 | -1 | -1 | 0 | 1 |
23 | 25 | 1 | 1 | -1 | 0 | 1 | 1 | 1 | 1 | -1 | ... | 1 | 1 | -1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
24 | 26 | 1 | 0 | 1 | 0 | -1 | 1 | 1 | -1 | 1 | ... | 1 | 0 | 0 | 0 | 1 | -1 | 1 | 0 | -1 | 1 |
25 | 27 | -1 | -1 | -1 | 1 | 1 | 1 | 1 | 0 | 1 | ... | 0 | 0 | 0 | 1 | 1 | 1 | 0 | -1 | 0 | 1 |
26 | 28 | 1 | 1 | 1 | 0 | 1 | 1 | -1 | -1 | 0 | ... | 0 | 0 | 1 | 1 | -1 | -1 | -1 | 1 | 1 | 1 |
27 | 29 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | ... | -1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | -1 |
28 | 30 | 1 | 1 | 1 | -1 | 1 | 1 | 0 | 1 | 1 | ... | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | -1 | 1 |
29 | 31 | -1 | 1 | 1 | 1 | -1 | -1 | 1 | 1 | -1 | ... | 1 | -1 | 1 | 1 | -1 | 0 | -1 | 1 | -1 | 1 |
30 | 32 | 1 | 1 | 0 | 0 | 1 | -1 | 0 | 0 | 0 | ... | 1 | -1 | 1 | -1 | -1 | 0 | 1 | 0 | 1 | 1 |
31 | 33 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | ... | 0 | 0 | -1 | 1 | 1 | -1 | -1 | 1 | 0 | -1 |
32 | 34 | 1 | -1 | -1 | 1 | 0 | 1 | 1 | 1 | -1 | ... | -1 | 1 | 0 | 1 | 0 | -1 | 1 | 1 | 0 | 1 |
33 | 35 | -1 | 1 | 1 | -1 | -1 | -1 | -1 | 1 | -1 | ... | 1 | -1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
34 | 36 | 1 | -1 | 1 | -1 | -1 | 0 | 1 | -1 | 1 | ... | -1 | 1 | 1 | -1 | 1 | 0 | 1 | 1 | 1 | -1 |
35 | 37 | -1 | 0 | 1 | -1 | -1 | 1 | -1 | 1 | 1 | ... | -1 | 1 | 1 | 1 | 1 | -1 | 1 | 0 | 1 | 1 |
36 | 38 | 1 | 1 | 1 | -1 | -1 | 1 | -1 | 1 | 1 | ... | -1 | 1 | 1 | 1 | 1 | 1 | -1 | 1 | 1 | -1 |
37 rows × 21 columns
import math
sum_array = []
move_array = [0.4]
for t in range(0,37):
sum = 0
for i in df.loc[t]:
if i == 1:
sum += 1
sum_array.append(sum/20)
#print(sum_array)
df["Round_Rate"] = sum_array
for i in range(1,37):
ans = round(((i*move_array[i-1]+sum_array[i])/(i+1)),3)
move_array.append(ans)
#print(move_array)
df["Mean_Rate"] = move_array
df
Round | 맨시티 | 맨유 | 리버풀 | 첼시 | 레스터 | 웨스트햄 | 토트넘 | 아스널 | 리즈 | ... | 울버햄튼 | 크팰 | 소튼 | 브라이튼 | 번리 | 풀럼 | 웨브 | 셰필드 | Round_Rate | Mean_Rate | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 2 | -2 | -2 | -1 | -1 | 1 | 1 | -1 | 1 | 1 | ... | -2 | -2 | -1 | -1 | 1 | 1 | 1 | -2 | 0.4 | 0.400 |
1 | 3 | 1 | -1 | -1 | 0 | 1 | -1 | 0 | -1 | 1 | ... | -1 | 1 | -1 | -1 | -1 | 1 | 0 | 1 | 0.4 | 0.400 |
2 | 4 | 0 | 1 | -1 | -1 | -1 | -1 | 1 | 1 | 0 | ... | 1 | -1 | 1 | 1 | 1 | 1 | 1 | 1 | 0.6 | 0.467 |
3 | 5 | -1 | -1 | 0 | 0 | 1 | 0 | 0 | -1 | -1 | ... | -1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 0.375 |
4 | 6 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | -1 | ... | 0 | 1 | -1 | 0 | 1 | 1 | 0 | 1 | 0.4 | 0.380 |
5 | 7 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | ... | -1 | -1 | -1 | 1 | 1 | -1 | -1 | 1 | 0.6 | 0.417 |
6 | 8 | 0 | -1 | 0 | 1 | 1 | 1 | 1 | 1 | -1 | ... | 1 | -1 | 1 | 0 | 0 | 1 | 1 | 1 | 0.6 | 0.443 |
7 | 9 | 1 | 1 | -1 | 1 | -1 | 1 | 1 | 0 | 0 | ... | 0 | -1 | 0 | -1 | -1 | 1 | 1 | 1 | 0.5 | 0.450 |
8 | 10 | 1 | -1 | 0 | 0 | -1 | -1 | 0 | 1 | -1 | ... | 1 | -1 | -1 | 0 | 1 | -1 | 1 | 1 | 0.3 | 0.433 |
9 | 11 | 1 | -1 | 1 | 1 | 1 | -1 | 1 | 1 | 1 | ... | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0.8 | 0.470 |
10 | 12 | 0 | 0 | 0 | -1 | 1 | 1 | 0 | -1 | 1 | ... | 1 | 0 | 1 | 1 | -1 | 0 | 1 | 1 | 0.5 | 0.473 |
11 | 13 | 0 | 1 | -1 | -1 | -1 | 0 | -1 | 0 | -1 | ... | -1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | 0.442 |
12 | 14 | -1 | 1 | 1 | 1 | -1 | 1 | -1 | 1 | 1 | ... | -1 | 1 | -1 | 0 | -1 | 0 | 1 | 0 | 0.5 | 0.446 |
13 | 15 | 1 | 0 | 0 | -1 | 0 | 0 | 0 | -1 | 1 | ... | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0.4 | 0.443 |
14 | 16 | -1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | ... | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 0.4 | 0.440 |
15 | 17 | 1 | 1 | -1 | 1 | 1 | -1 | 1 | 1 | 1 | ... | 0 | 1 | -1 | 0 | 0 | 0 | 1 | 1 | 0.6 | 0.450 |
16 | 18 | 1 | 1 | -1 | 1 | 1 | 1 | 1 | 0 | -1 | ... | 1 | 0 | -1 | 1 | -1 | 1 | 1 | -1 | 0.6 | 0.459 |
17 | 19 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | -1 | ... | -1 | 1 | 1 | -1 | 1 | 1 | -1 | 1 | 0.6 | 0.467 |
18 | 20 | 1 | -1 | 1 | 0 | 0 | 1 | 1 | -1 | 1 | ... | 0 | 1 | -1 | 0 | -1 | 0 | 1 | -1 | 0.4 | 0.463 |
19 | 21 | 1 | 0 | 1 | 1 | -1 | 1 | -1 | 0 | -1 | ... | -1 | -1 | 1 | -1 | 1 | 0 | 0 | 1 | 0.4 | 0.460 |
20 | 22 | 1 | 1 | -1 | -1 | 1 | 1 | -1 | -1 | 1 | ... | -1 | 1 | 1 | -1 | 1 | 1 | -1 | -1 | 0.6 | 0.467 |
21 | 23 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | ... | 0 | 1 | -1 | 0 | 0 | 0 | 1 | 1 | 0.5 | 0.469 |
22 | 24 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | -1 | -1 | ... | -1 | -1 | -1 | 0 | -1 | -1 | 0 | 1 | 0.4 | 0.466 |
23 | 25 | 1 | 1 | -1 | 0 | 1 | 1 | 1 | 1 | -1 | ... | -1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0.6 | 0.472 |
24 | 26 | 1 | 0 | 1 | 0 | -1 | 1 | 1 | -1 | 1 | ... | 0 | 0 | 1 | -1 | 1 | 0 | -1 | 1 | 0.5 | 0.473 |
25 | 27 | -1 | -1 | -1 | 1 | 1 | 1 | 1 | 0 | 1 | ... | 0 | 1 | 1 | 1 | 0 | -1 | 0 | 1 | 0.5 | 0.474 |
26 | 28 | 1 | 1 | 1 | 0 | 1 | 1 | -1 | -1 | 0 | ... | 1 | 1 | -1 | -1 | -1 | 1 | 1 | 1 | 0.5 | 0.475 |
27 | 29 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | ... | 1 | 0 | 1 | 1 | 0 | 1 | 1 | -1 | 0.6 | 0.479 |
28 | 30 | 1 | 1 | 1 | -1 | 1 | 1 | 0 | 1 | 1 | ... | 1 | 0 | 1 | 1 | 1 | 1 | -1 | 1 | 0.7 | 0.487 |
29 | 31 | -1 | 1 | 1 | 1 | -1 | -1 | 1 | 1 | -1 | ... | 1 | 1 | -1 | 0 | -1 | 1 | -1 | 1 | 0.5 | 0.487 |
30 | 32 | 1 | 1 | 0 | 0 | 1 | -1 | 0 | 0 | 0 | ... | 1 | -1 | -1 | 0 | 1 | 0 | 1 | 1 | 0.4 | 0.484 |
31 | 33 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | ... | -1 | 1 | 1 | -1 | -1 | 1 | 0 | -1 | 0.5 | 0.484 |
32 | 34 | 1 | -1 | -1 | 1 | 0 | 1 | 1 | 1 | -1 | ... | 0 | 1 | 0 | -1 | 1 | 1 | 0 | 1 | 0.5 | 0.484 |
33 | 35 | -1 | 1 | 1 | -1 | -1 | -1 | -1 | 1 | -1 | ... | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0.6 | 0.487 |
34 | 36 | 1 | -1 | 1 | -1 | -1 | 0 | 1 | -1 | 1 | ... | 1 | -1 | 1 | 0 | 1 | 1 | 1 | -1 | 0.5 | 0.487 |
35 | 37 | -1 | 0 | 1 | -1 | -1 | 1 | -1 | 1 | 1 | ... | 1 | 1 | 1 | -1 | 1 | 0 | 1 | 1 | 0.6 | 0.490 |
36 | 38 | 1 | 1 | 1 | -1 | -1 | 1 | -1 | 1 | 1 | ... | 1 | 1 | 1 | 1 | -1 | 1 | 1 | -1 | 0.7 | 0.496 |
37 rows × 23 columns
df["Round_Rate"].value_counts()
0.6 11 0.5 11 0.4 9 0.1 2 0.7 2 0.3 1 0.8 1 Name: Round_Rate, dtype: int64
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib notebook
sns.barplot(data=df, x="Round", y="Round_Rate")
plt.show()
sns.lineplot(data=df, x="Round", y="Mean_Rate")
plt.show()