We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fc6982 commit 944d3d6Copy full SHA for 944d3d6
braininventory/get.py
@@ -7,18 +7,14 @@
7
import matplotlib.pyplot as plt
8
9
10
-url = 'https://download.brainimagelibrary.org/inventory/daily/reports/today.json'
11
-file_path, _ = urllib.request.urlretrieve(url)
12
-df = pd.read_json(file_path)
13
-items = df.affiliation.unique()
14
-frequency = {}
15
-
16
-for item in items:
17
- if item in frequency:
18
- frequency[item] += 1
19
- else:
20
- frequency[item] = 1
21
-print(frequency)
+def __get_affiliation_frequency(df):
+ '''
+ Get affiliation frequency.
+
+ Input: dataframe
+ Output: a frequency dictionary
+ return df['affiliation'].value_counts().to_dict()
22
23
def today():
24
"""
0 commit comments