From 5cfd16280885d27b9f23079f0ef78c7009d42d64 Mon Sep 17 00:00:00 2001 From: Lawrence Andrew <42677990+Lawrence-h-andrew@users.noreply.github.com> Date: Tue, 29 Jan 2019 20:42:59 -0500 Subject: [PATCH 1/2] Initial Scatterplot code Starter code for ScatterPlot. Will add more through the week so the variables can be renamed as categories. --- ScatterPlot.ipynb | 286 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 286 insertions(+) create mode 100644 ScatterPlot.ipynb diff --git a/ScatterPlot.ipynb b/ScatterPlot.ipynb new file mode 100644 index 0000000..f65ef90 --- /dev/null +++ b/ScatterPlot.ipynb @@ -0,0 +1,286 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Unnamed: 0advisoriescategorycausecharityNamecharityNavigatorURLcurrentRatingdonationAddresseinirsClassificationmailingAddressmissionorgIDorganizationtagLinewebsiteURL
00{'severity': None, 'active': {'_rapid_links': ...{'categoryName': 'Research and Public Policy',...{'causeID': 35, 'causeName': 'Non-Medical Scie...Mount Desert Island Biological Laboratoryhttps://www.charitynavigator.org/?bay=search.s...{'score': 92.61, 'ratingID': 131800, 'publicat...{'country': None, 'stateOrProvince': 'ME', 'ci...10202467{'deductibility': 'Contributions are deductibl...{'country': None, 'stateOrProvince': 'ME', 'ci...The MDI Biological Laboratory is a rapidly gro...5954{'charityName': 'Mount Desert Island Biologica...Connecting Science, Environment, and Healthhttp://www.mdibl.org/
11{'severity': None, 'active': {'_rapid_links': ...{'categoryName': 'Community Development', 'cat...{'causeID': 42, 'causeName': 'United Ways', 'c...United Way of Eastern Mainehttps://www.charitynavigator.org/?bay=search.s...{'score': 81.84, 'ratingID': 138738, 'publicat...NaN10211478{'deductibility': 'Contributions are deductibl...{'country': None, 'stateOrProvince': 'ME', 'ci...Working with the communities we serve, the Uni...12517{'charityName': 'United Way of Eastern Maine',...Live unitedhttps://www.unitedwayem.org/
22{'severity': None, 'active': {'_rapid_links': ...{'categoryName': 'Health', 'categoryID': 5, 'c...{'causeID': 14, 'causeName': 'Medical Research...The Jackson Laboratoryhttps://www.charitynavigator.org/?bay=search.s...{'score': 93.16, 'ratingID': 131608, 'publicat...{'country': None, 'stateOrProvince': 'ME', 'ci...10211513{'deductibility': 'Contributions are deductibl...{'country': None, 'stateOrProvince': 'ME', 'ci...The Jackson Laboratory, founded in 1929, is an...3916{'charityName': 'The Jackson Laboratory', 'ein...Leading the search for tomorrow's cureshttp://www.jax.org
33{'severity': None, 'active': {'_rapid_links': ...{'categoryName': 'Arts, Culture, Humanities', ...{'causeID': 6, 'causeName': 'Libraries, Histor...Maine Historical Societyhttps://www.charitynavigator.org/?bay=search.s...{'score': 80.31, 'ratingID': 124121, 'publicat...NaN10211530{'deductibility': 'Contributions are deductibl...{'country': None, 'stateOrProvince': 'ME', 'ci...Founded in 1822, the Maine Historical Society ...15533{'charityName': 'Maine Historical Society', 'e...Preserving history, engaging minds, connecting...http://www.mainehistory.org/
44{'severity': None, 'active': {'_rapid_links': ...{'categoryName': 'Human Services', 'categoryID...{'causeID': 16, 'causeName': 'Youth Developmen...Boys & Girls Clubs of Southern Mainehttps://www.charitynavigator.org/?bay=search.s...{'score': 91.54, 'ratingID': 135033, 'publicat...NaN10211543{'deductibility': 'Contributions are deductibl...{'country': None, 'stateOrProvince': 'ME', 'ci...For more than 100 years, Boys & Girls Clubs of...15222{'charityName': 'Boys & Girls Clubs of Souther...Great Futures Start Herehttp://www.bgcmaine.org/home
\n", + "
" + ], + "text/plain": [ + " Unnamed: 0 advisories \\\n", + "0 0 {'severity': None, 'active': {'_rapid_links': ... \n", + "1 1 {'severity': None, 'active': {'_rapid_links': ... \n", + "2 2 {'severity': None, 'active': {'_rapid_links': ... \n", + "3 3 {'severity': None, 'active': {'_rapid_links': ... \n", + "4 4 {'severity': None, 'active': {'_rapid_links': ... \n", + "\n", + " category \\\n", + "0 {'categoryName': 'Research and Public Policy',... \n", + "1 {'categoryName': 'Community Development', 'cat... \n", + "2 {'categoryName': 'Health', 'categoryID': 5, 'c... \n", + "3 {'categoryName': 'Arts, Culture, Humanities', ... \n", + "4 {'categoryName': 'Human Services', 'categoryID... \n", + "\n", + " cause \\\n", + "0 {'causeID': 35, 'causeName': 'Non-Medical Scie... \n", + "1 {'causeID': 42, 'causeName': 'United Ways', 'c... \n", + "2 {'causeID': 14, 'causeName': 'Medical Research... \n", + "3 {'causeID': 6, 'causeName': 'Libraries, Histor... \n", + "4 {'causeID': 16, 'causeName': 'Youth Developmen... \n", + "\n", + " charityName \\\n", + "0 Mount Desert Island Biological Laboratory \n", + "1 United Way of Eastern Maine \n", + "2 The Jackson Laboratory \n", + "3 Maine Historical Society \n", + "4 Boys & Girls Clubs of Southern Maine \n", + "\n", + " charityNavigatorURL \\\n", + "0 https://www.charitynavigator.org/?bay=search.s... \n", + "1 https://www.charitynavigator.org/?bay=search.s... \n", + "2 https://www.charitynavigator.org/?bay=search.s... \n", + "3 https://www.charitynavigator.org/?bay=search.s... \n", + "4 https://www.charitynavigator.org/?bay=search.s... \n", + "\n", + " currentRating \\\n", + "0 {'score': 92.61, 'ratingID': 131800, 'publicat... \n", + "1 {'score': 81.84, 'ratingID': 138738, 'publicat... \n", + "2 {'score': 93.16, 'ratingID': 131608, 'publicat... \n", + "3 {'score': 80.31, 'ratingID': 124121, 'publicat... \n", + "4 {'score': 91.54, 'ratingID': 135033, 'publicat... \n", + "\n", + " donationAddress ein \\\n", + "0 {'country': None, 'stateOrProvince': 'ME', 'ci... 10202467 \n", + "1 NaN 10211478 \n", + "2 {'country': None, 'stateOrProvince': 'ME', 'ci... 10211513 \n", + "3 NaN 10211530 \n", + "4 NaN 10211543 \n", + "\n", + " irsClassification \\\n", + "0 {'deductibility': 'Contributions are deductibl... \n", + "1 {'deductibility': 'Contributions are deductibl... \n", + "2 {'deductibility': 'Contributions are deductibl... \n", + "3 {'deductibility': 'Contributions are deductibl... \n", + "4 {'deductibility': 'Contributions are deductibl... \n", + "\n", + " mailingAddress \\\n", + "0 {'country': None, 'stateOrProvince': 'ME', 'ci... \n", + "1 {'country': None, 'stateOrProvince': 'ME', 'ci... \n", + "2 {'country': None, 'stateOrProvince': 'ME', 'ci... \n", + "3 {'country': None, 'stateOrProvince': 'ME', 'ci... \n", + "4 {'country': None, 'stateOrProvince': 'ME', 'ci... \n", + "\n", + " mission orgID \\\n", + "0 The MDI Biological Laboratory is a rapidly gro... 5954 \n", + "1 Working with the communities we serve, the Uni... 12517 \n", + "2 The Jackson Laboratory, founded in 1929, is an... 3916 \n", + "3 Founded in 1822, the Maine Historical Society ... 15533 \n", + "4 For more than 100 years, Boys & Girls Clubs of... 15222 \n", + "\n", + " organization \\\n", + "0 {'charityName': 'Mount Desert Island Biologica... \n", + "1 {'charityName': 'United Way of Eastern Maine',... \n", + "2 {'charityName': 'The Jackson Laboratory', 'ein... \n", + "3 {'charityName': 'Maine Historical Society', 'e... \n", + "4 {'charityName': 'Boys & Girls Clubs of Souther... \n", + "\n", + " tagLine \\\n", + "0 Connecting Science, Environment, and Health \n", + "1 Live united \n", + "2 Leading the search for tomorrow's cures \n", + "3 Preserving history, engaging minds, connecting... \n", + "4 Great Futures Start Here \n", + "\n", + " websiteURL \n", + "0 http://www.mdibl.org/ \n", + "1 https://www.unitedwayem.org/ \n", + "2 http://www.jax.org \n", + "3 http://www.mainehistory.org/ \n", + "4 http://www.bgcmaine.org/home " + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "%matplotlib inline\n", + "\n", + "import matplotlib.pyplot as plt\n", + "import pandas as pd\n", + "import numpy as np\n", + "\n", + "charity_data = \"All_Organizations.csv\"\n", + "charity_df = pd.read_csv(\"All_Organizations.csv\")\n", + "charity_df.head()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From f8c5e0a78bfbb8a05f4a09f5692eed3de42edbae Mon Sep 17 00:00:00 2001 From: Lawrence Andrew <42677990+Lawrence-h-andrew@users.noreply.github.com> Date: Thu, 31 Jan 2019 19:17:25 -0500 Subject: [PATCH 2/2] Updated code, doing this through browser Does this overwrite the file?