Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions braininventory/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,24 @@ def __get_affiliations(df):
return df["affiliation"].value_counts().keys()


import urllib.request
import matplotlib.pyplot as plt


url = 'https://download.brainimagelibrary.org/inventory/daily/reports/today.json' #get library
file_path, _ = urllib.request.urlretrieve(url)
df = pd.read_json(file_path) #the dataframe
items = df.affiliation #get the category affiliation
frequency = {} #add affiliation items here

for item in items:
if item in frequency:
frequency[item] += 1 #if the item is already in frequency, then add one
else:
frequency[item] = 1 #if the item is not in the frequency, then add that item and set it to onbe

print(frequency)

def today():
"""
Get the daily inventory report data for today.
Expand Down