Skip to content

Commit 8fc6982

Browse files
authored
Update get.py
1 parent 34b1a23 commit 8fc6982

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

braininventory/get.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
import pandas as pd
33
import json
44
from datetime import date
5+
import pandas as pd
6+
import urllib.request
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)
522

623
def today():
724
"""

0 commit comments

Comments
 (0)