Skip to content

Commit c66d9a5

Browse files
authored
Update get.py
1 parent 1be9665 commit c66d9a5

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

braininventory/get.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,29 @@ def __get_number_of_projects(df):
132132
import urllib.request
133133
import matplotlib.pyplot as plt
134134
import pandas as pd
135-
135+
'''
136+
Import modules to create treemap of the frenquency of projects in the dataset
137+
'''
136138
url = 'https://download.brainimagelibrary.org/inventory/daily/reports/today.json'
137139
file_path, _ = urllib.request.urlretrieve(url)
138140
df = pd.read_json(file_path)
139-
141+
'''
142+
Link for the data that will be used
143+
'''
140144
def get_projects_treemaps(df):
145+
'''
146+
name function for treemap of projects
147+
'''
141148
df = df['project'].value_counts().to_dict()
142149
sizes_list = list(df.values())
143150
names_list = list(df.keys())
144151
squarify.plot(sizes_list)
145152
plt.show()
153+
'''
154+
Input: project values
155+
Output: treemap graph of projects frequency
156+
Created a code for the visualization of projects frequency
157+
'''
146158
get_projects_treemaps(df)
147159

148160

0 commit comments

Comments
 (0)