File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 2
2
import pandas as pd
3
3
import json
4
4
from datetime import date
5
+ import pandas as pd
6
+ import matplotlib .pyplot as plt
5
7
from pandarallel import pandarallel
6
8
7
9
pandarallel .initialize (nb_workers = 8 , progress_bar = True )
@@ -31,6 +33,16 @@ def today():
31
33
return pd .DataFrame ()
32
34
33
35
36
+ def __get_affiliation_frequency (df ):
37
+ """
38
+ Get affiliation frequency.
39
+
40
+ Input: dataframe
41
+ Output: a frequency dictionary
42
+ """
43
+ return df ["affiliation" ].value_counts ().to_dict ()
44
+
45
+
34
46
def __get_number_of_datasets (df ):
35
47
return len (df )
36
48
@@ -195,8 +207,10 @@ def report():
195
207
# Convert date to string
196
208
tdate = tdate .strftime ("%Y%m%d" )
197
209
210
+ # Get today's data info
198
211
df = today ()
199
212
213
+ # Build report
200
214
report = {}
201
215
report ["date" ] = tdate
202
216
report ["number_of_datasets" ] = __get_number_of_datasets (df )
You can’t perform that action at this time.
0 commit comments