File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import requests
21import sys
2+
3+ import matplotlib .pyplot as plt
34import pandas
45import seaborn as sns
5- import matplotlib .pyplot as plt
66
77pandas .options .mode .chained_assignment = None
88
99tournament : str = ""
1010try :
11- tournament : str = sys .argv [1 ].split ("/" )[- 1 ]
11+ tournament = sys .argv [1 ].split ("/" )[- 1 ]
1212except IndexError :
1313 print ("No tournament (e.g. 2019-06-01_nationals_c) provided!" )
1414 exit (1 )
15- r = requests .get (f"https://duosmium.org/results/{ tournament } " )
16- comp_yaml = requests .get (f"https://duosmium.org/data/{ tournament } .yaml" )
17- p = pandas .read_html (r .text )
18- table = p [0 ]
19- table = table [table .columns [4 :- 1 ]]
20- table .columns = [c .replace (" Td" , "" ).replace (" T" , "" ) for c in table .columns ]
21- corr = table .corr ()
15+
16+ table = pandas .read_csv (f"https://duosmium.org/results/csv/{ tournament } /" )
17+ table = table [table .columns [8 :]]
18+ corr = table .corr (numeric_only = True )
2219plt .figure (figsize = (20 , 20 ))
23- sns .heatmap (data = corr , annot = True , cmap = "YlGnBu" ).get_figure ().savefig (f"{ tournament } _corr .png" )
20+ sns .heatmap (data = corr , annot = True , cmap = "YlGnBu" ).get_figure ().savefig (f"corr .png" )
You can’t perform that action at this time.
0 commit comments