Created
May 14, 2021 07:03
-
-
Save ramiroaznar/77387205830cb86748ead82a916f564f to your computer and use it in GitHub Desktop.
Get aggregated metrics from lascallesdelasmujeres geochicas project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pandas as pd | |
import json | |
# clone lascallesdelasmujeres github repository | |
# cd /lascallesdelasmujeres | |
json_list = [] | |
for root, dirs, files in os.walk(os.getcwd() + '/data'): | |
for file in files: | |
if file == 'stats.txt': | |
with open(root + '/' + file) as f: | |
json_data = json.load(f) | |
json_list.append(json_data) | |
df = pd.DataFrame(json_list) | |
print( | |
df.numFemale.sum(), | |
df.numMale.sum(), | |
df.totalNames.sum(), | |
round(df.numFemale.sum()*100.00/df.totalNames.sum(),2) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment