Last active
March 10, 2017 08:19
-
-
Save allisonmorgan/10f703892f643a0a979cab6a53ef6c1f to your computer and use it in GitHub Desktop.
"Who are the scientists who oppose Trump’s travel ban?" supplement
This file contains 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
Computer and Information Systems | |
---|---|
Computer Science | |
Computer Systems Analysis | |
Information Sciences | |
Computer Administration Management and Security | |
Computer Networking and Telecommunications | |
Miscellaneous Computer Sciences | |
Mathematics | |
Applied Mathematics | |
Statistics | |
Decision Science | |
Miscellaneous Mathematics | |
General Agriculture | |
Agriculture Production and Management | |
Agricultural Economics | |
Animal Sciences | |
Food Science | |
Plant Science and Agronomy | |
Soil Science | |
Miscellaneous Agriculture | |
Environmental Science | |
Forestry | |
Natural Resources Management | |
Biology | |
Biochemical Sciences | |
Botany | |
Molecular Biology | |
Ecology | |
Genetics | |
Microbiology | |
Pharmacology | |
Physiology | |
Zoology | |
Epidemiology | |
Miscellaneous Biology | |
Physical Sciences | |
Astronomy and Astrophysics | |
Atmospheric Sciences and Meteorology | |
Chemistry | |
Geology and Earth Science | |
Geosciences | |
Oceanography | |
Physics | |
Miscellaneous Physical Sciences | |
Psychology | |
Educational Psychology | |
Clinical Psychology | |
Counseling Psychology | |
Experimental Psychology | |
Industrial and Organizational Psychology | |
Social Psychology | |
Miscellaneous Psychology | |
Area Ethnic and Civilization Studies | |
General Social Sciences | |
Economics | |
Anthropology and Archeology | |
Criminology | |
Geography | |
International Relations | |
Political Science and Government | |
Sociology | |
Miscellaneous Social Sciences | |
History and Philosophy of Science and Technology | |
General Engineering | |
Aerospace Engineering | |
Biological Engineering | |
Architectural Engineering | |
Biomedical Engineering | |
Chemical Engineering | |
Civil Engineering | |
Computer Engineering | |
Electrical Engineering | |
Engineering Mechanics Physics and Science | |
Environmental Engineering | |
Geological and Geophysical Engineering | |
Industrial and Manufacturing Engineering | |
Materials Engineering and Materials Science | |
Mechanical Engineering | |
Metallurgical Engineering | |
Mining and Mineral Engineering | |
Naval Architecture and Marine Engineering | |
Nuclear Engineering | |
Petroleum Engineering | |
Operations Research | |
Miscellaneous Engineering | |
Intercultural and International Studies | |
Nutrition Sciences | |
Neuroscience | |
Accounting and Computer Science | |
Mathematics and Computer Science | |
Cognitive Science and Biopsychology | |
Interdisciplinary Social Sciences | |
Multidisciplinary or General Science | |
Architecture | |
Computer Programming | |
Data Processing | |
Computer Teacher Education | |
Mathematics Teacher Education | |
Science Teacher Education | |
Engineering Technologies | |
Engineering and Industrial Management | |
Electrical Engineering Technology | |
Industrial Production Technologies | |
Mechanical Engineering Related Technologies | |
Miscellaneous Engineering Technologies | |
Applied Biotechnology | |
Nuclear and Industrial Radiology Technologies | |
General Medical and Health Services | |
Communication Disorders Sciences and Services | |
Health and Medical Administrative Services | |
Medical Assisting Services | |
Medical Technologies Technicians | |
Health and Medical Preparatory Programs | |
Nursing | |
Pharmacy Pharmaceutical Sciences and Administration | |
Treatment Therapy Professions | |
Community and Public Health | |
Energy and Biologically Based Therapies | |
Miscellaneous Health Medical Professions | |
Court Reporting | |
Medical Office Assistance and Administration | |
General Business | |
Accounting | |
Actuarial Science | |
Business Management and Administration | |
Operations Logistics and E-Commerce | |
Business Economics | |
Marketing | |
Finance | |
Marketing Research | |
Human Resources and Personnel Management | |
International Business | |
Hospitality Management | |
Management Information Systems and Statistics | |
Miscellaneous Business | |
General Education | |
Educational Administration and Supervision | |
School Student Counseling | |
Elementary Education | |
Physical and Health Education Teaching | |
Early Childhood Education | |
Secondary Teacher Education | |
Special Needs Education | |
Social Science or History Teacher Education | |
Teacher Education: Multiple Levels | |
Language and Drama Education | |
Art and Music Education | |
Miscellaneous Education | |
Linguistics and Comparative Language and Literature | |
French, German, Latin, and Other Common Foreign | |
Language Studies | |
Other Foreign Languages | |
English Language and Literature | |
Composition and Speech | |
Liberal Arts | |
Humanities | |
Philosophy and Religious Studies | |
Theology and Religious Vocations | |
History | |
U.S. History | |
Fine Arts | |
Drama and Theater Arts | |
Music | |
Visual and Performing Arts | |
Commercial Art and Graphic Design | |
Film Video and Photographic Arts | |
Art History and Criticism | |
Studio Arts | |
Miscellaneous Fine Arts | |
Communications | |
Journalism | |
Mass Media | |
Advertising and Public Relations | |
Communication Technologies | |
Cosmetology Services and Culinary Arts | |
Family and Consumer Sciences | |
Technology Education Industrial Arts | |
Pre-Law and Legal Studies | |
Library Science | |
Military Technologies | |
Physical Fitness, Parks, Recreation, and Leisure | |
Criminal Justice and Fire Protection | |
Public Administration | |
Public Policy | |
Human Services and Community Organization | |
Social Work | |
Construction Services | |
Electrical and Mechanic Repairs and Technologies | |
Precision Production | |
Transportation Sciences and Technologies |
This file contains 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
from collections import Counter | |
import json | |
import csv | |
if __name__ == "__main__": | |
# Load all of US Census's academic disciplines | |
disciplines = []; discipline_color = {}; | |
with open('census_disciplines.csv', 'rb') as csvfile: | |
reader = csv.reader(csvfile) | |
for i, row in enumerate(reader): | |
disciplines.append(row[0].lower()) | |
# These different colors correspond to broad category | |
# the census assigns to a discipline | |
if i < 93: | |
discipline_color[row[0].lower()] = "#a6cee3" | |
elif i < 119: | |
discipline_color[row[0].lower()] = "#1f78b4" | |
elif i < 135: | |
discipline_color[row[0].lower()] = "#b2df8a" | |
elif i < 148: | |
discipline_color[row[0].lower()] = "#33a02c" | |
else: | |
discipline_color[row[0].lower()] = "#fb9a99" | |
print "number of disciplines: {0}".format(len(disciplines)) | |
# Read people JSON | |
with open("signatures.json", "rb") as f: | |
data = json.loads(f.read().decode("utf-8")) | |
areas_count = Counter() | |
for i, person in enumerate(data["data"]): | |
title = person[2] | |
# Look for discipline matches | |
for discipline in disciplines: | |
if title.lower().count(discipline) > 0: | |
areas_count[discipline.title()] += 1 | |
writer = csv.writer(open("discipline_counts.csv", 'w')) | |
writer.writerow(['id', 'value', 'color']) | |
for area, count in areas_count.most_common(): | |
writer.writerow([area.encode('utf-8'), count, discipline_color[area.lower()]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment