{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\n#import numpy as np # linear algebra\n#import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\n#import os\n#for dirname, _, filenames in os.walk('/kaggle/input'):\n#    for filename in filenames:\n#        print(os.path.join(dirname, filename))\n\n# You can write up to 5GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# CDP: Unlocking climate solutions - Data Visualization"},{"metadata":{},"cell_type":"markdown","source":"## Importing CDP datasets\n## Importing external dataset\n## Cities responses\n### **Question 0.1(INTRODUCTION)\n### **Question 1.0(GOVERNANCE AND DATA MANAGEMENT)\n### **Question 2.0(CLIMATE HAZARD)\n### **Question 2.2(CLIMATE HAZARD)\n### **Question 4.0(CITY-WIDE EMISSIONS)\n### **Question 6.1(OPPORTUNITIES)\n### **Question 8.0(ENERGY)\n### **Question 10.11(TRANSPORT)\n### **Question 14.3(WATER SECURITY)\n### **Question 14.0(WATER SECURITY)\n## SVI\n### **E_POV\n### **E_UNEMP\n### **E_NOHSDP\n### **E_MINRTY\n### **E_CROWD\n### **E_NOVEH"},{"metadata":{"trusted":true},"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport plotly.express as px\nimport plotly.graph_objects as go","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"#importing CDP datasets\ncitiesDisclosing2019 = pd.read_csv('/kaggle/input/cdp-unlocking-climate-solutions/Cities/Cities Disclosing/2019_Cities_Disclosing_to_CDP.csv')\ncitiesDisclosing2019 = citiesDisclosing2019[['Account Number','Country', 'City']]\n\nfullcitiesDataset2019 = pd.read_csv('/kaggle/input/cdp-unlocking-climate-solutions/Cities/Cities Responses/2019_Full_Cities_Dataset.csv')\nfullCitiesDataset2019= fullcitiesDataset2019.insert(0, 'Year', '2019')\nfullCitiesDataset2019= fullcitiesDataset2019.replace(r'^\\s*$', np.nan, regex=True)\nfullCitiesDataset2019['Year'] = pd.to_datetime(fullCitiesDataset2019['Year'], format = '%Y').dt.year\n\n\nusCities = pd.read_csv('/kaggle/input/cdp-unlocking-climate-solutions/Supplementary Data/Simple Maps US Cities Data/uscities.csv')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"## Importing external dataset- Countries and their codes"},{"metadata":{"trusted":true},"cell_type":"code","source":"#a = countriesDataset['Country'].unique().tolist()\n#total_a = len(a)\n#print(a)\n#print(\"\\nTotal a countriesDataset present: \",total_a)\n\n#b = citiesDataset2019['Country'].unique().tolist()\n#total_b = len(b)\n#print(\"\\nTotal b citiesDataset2019 present: \",total_b)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"countriesDataset = pd.read_csv('../input/country-codes/wikipedia-iso-country-codes.csv')\ncountriesDataset = countriesDataset[['Country','Code']]\n\n\ncountriesDataset['Country'] = countriesDataset['Country'].replace({\"Korea, Democratic People's Republic of\": 'Republic of Korea'})\ncountriesDataset['Country'] = countriesDataset['Country'].replace({'United Kingdom': 'United Kingdom of Great Britain and Northern Ireland'})\ncountriesDataset['Country'] = countriesDataset['Country'].replace({'Taiwan':'Taiwan, Greater China'})\ncountriesDataset['Country'] = countriesDataset['Country'].replace({'Russia':'Russian Federation'})\ncountriesDataset['Country'] = countriesDataset['Country'].replace({'Palestinian Territory, Occupied':'State of Palestine'})\ncountriesDataset['Country'] = countriesDataset['Country'].replace({'Congo, the Democratic Republic of the':'Democratic Republic of the Congo'})\ncountriesDataset['Country'] = countriesDataset['Country'].replace({'Bolivia':'Bolivia (Plurinational State of)'})\ncountriesDataset['Country'] = countriesDataset['Country'].replace({'Vietnam':'Viet Nam'})\ncountriesDataset['Country'] = countriesDataset['Country'].replace({'Hong Kong':'Hong Kong Special Administrative Region'})\ncountriesDataset['Country'] = countriesDataset['Country'].replace({'Venezuela':'Venezuela (Bolivarian Republic of)'})\ncountriesDataset['Country'] = countriesDataset['Country'].replace({'United States Of America':'United States of America'})\n\n","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Reference: https://www.kaggle.com/juanumusic/countries-iso-codes"},{"metadata":{},"cell_type":"markdown","source":"# CITIES RESPONSES 2019"},{"metadata":{"trusted":true},"cell_type":"code","source":"citiesDataset_19 = fullCitiesDataset2019[['Year','Account Number','Organization','Country','Question Number','Question Name','Response Answer']]\ncitiesDataset_19 = pd.merge(citiesDataset_19,countriesDataset, how = 'left', on = 'Country')\n#citiesDataset_19","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### merging 2019 cities disclosing data with 2019 cities data to include 'city' column"},{"metadata":{"trusted":true},"cell_type":"code","source":"citiesDataset2019= pd.merge(citiesDataset_19,citiesDisclosing2019, how = 'left')\n#citiesDataset2019","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Questions based on CDP's recommendations"},{"metadata":{},"cell_type":"markdown","source":"### Question 0.1(INTRODUCTION) - Please give a general desription and introduction to your city including your city's reporting boundary in the table below. [administrative boundary, description of the city]"},{"metadata":{"trusted":true},"cell_type":"code","source":"question_01 = citiesDataset2019.loc[citiesDataset2019['Question Number']== '0.1']\n\nLGA = question_01.loc[question_01['Response Answer']== 'Local government area within a city / metropolitan area']\ncity_Municipality = question_01.loc[question_01['Response Answer']== 'City / Municipality']\nindependent_City  = question_01.loc[question_01['Response Answer']== 'Independent city']\nspecial_City   = question_01.loc[question_01['Response Answer']== 'Special city']\nfederal_District    = question_01.loc[question_01['Response Answer']== 'Federal district']\nsovereign_City_State     = question_01.loc[question_01['Response Answer']== 'Sovereign city-state']\nmetropolitan_Area      = question_01.loc[question_01['Response Answer']== 'Metropolitan area']\nprovince_County       = question_01.loc[question_01['Response Answer']== 'Province / County']\nindependent_Province        = question_01.loc[question_01['Response Answer']== 'Independent province'] \nintercommunality        = question_01.loc[question_01['Response Answer']== 'Intercommunality']\nsub_Municipal_District        = question_01.loc[question_01['Response Answer']== 'Sub-municipal district']\nother = question_01.loc[question_01['Response Answer']== 'Other']\n\ncity_Description = pd.concat([LGA,city_Municipality,independent_City,special_City,federal_District,sovereign_City_State,metropolitan_Area,province_County,\n                             independent_Province,intercommunality,sub_Municipal_District,other])\ncity_Description1 = city_Description.groupby(['Response Answer'],as_index = False).count()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_kg_hide-output":false},"cell_type":"code","source":"plt.figure(figsize=(20,18))\ncity_Descriptionfig1 = px.choropleth(city_Description,  locations= \"Code\", color = 'Response Answer', hover_name= \"City\", scope='world',width=900,height=800, color_continuous_scale= px.colors.sequential.Viridis)\ncity_Descriptionfig1.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Note: The very light blue areas on the map are either not included in the dataset or those cities did not provide an answer to question "},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(10,8))\nplt.xticks(rotation='vertical')\ncity_Descriptionfig2 = sns.lineplot(x = 'Response Answer', y= 'Question Number', data = city_Description1)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Question 1.0(GOVERNANCE AND DATA MANAGEMENT)- Does your city incorporate sustainability goals and targets(e.g GHG reductions) into master planning for the city?"},{"metadata":{"trusted":true},"cell_type":"code","source":"question_1 = citiesDataset2019.loc[citiesDataset2019['Question Number']== '1.0']\n\nnotIntending = question_1.loc[question_1['Response Answer']== 'Not intending to incorporate']\ndoNotKnow = question_1.loc[question_1['Response Answer']== 'Do not know'] \ninProgress = question_1.loc[question_1['Response Answer']== 'In progress'] \nintending = question_1.loc[question_1['Response Answer']== 'Intending to incorporate in the next 2 years']\nyes = question_1.loc[question_1['Response Answer']== 'Yes'] \n\nquestion1_Response = pd.concat([notIntending,doNotKnow,inProgress,intending,yes])\n\nquestion1_Responsefig = px.scatter_geo(question1_Response, locations=\"Code\",width=800,height = 700, color=\"Response Answer\", hover_name=\"City\",projection=\"natural earth\")\nquestion1_Responsefig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Question 2.0(CLIMATE HAZARD) - Has the climate risk or vulnerability assessment been undertaken for your city area?\n"},{"metadata":{"trusted":true},"cell_type":"code","source":"question_2 = citiesDataset2019.loc[citiesDataset2019['Question Number']== '2.0']\n\n#question_2.groupby('Response Answer')['Response Answer'].count()\n\nnotIntending = question_2.loc[question_2['Response Answer']== 'Not intending to undertake']\nyes = question_2.loc[question_2['Response Answer']== 'Yes'] \ndoNotKnow = question_2.loc[question_2['Response Answer']== 'Do not know'] \ninProgress = question_2.loc[question_2['Response Answer']== 'In progress']\nintending = question_2.loc[question_2['Response Answer']== 'Intending to undertake in the next 2 years']\n\nquestion_2_Response = pd.concat([notIntending,yes,doNotKnow,inProgress,intending])\n\nquestion_2_Responsefig = px.choropleth(question_2_Response,  locations= \"Code\", color = 'Response Answer', hover_name= \"City\", scope='world',width=800, height=700, color_continuous_scale= px.colors.sequential.Viridis)\nquestion_2_Responsefig","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Question 2.2(CLIMATE HAZARD)- Please identify the factors that most greatly affect your city's ability to adapt to climate change...****"},{"metadata":{"trusted":true},"cell_type":"code","source":"question_2_2 = citiesDataset2019.loc[citiesDataset2019['Question Number']== '2.2']\n\nquestion_2_2_groupby = question_2_2.groupby(['Response Answer'],as_index = False).count()\nquestion_2_2Response = question_2_2_groupby.sort_values (by = 'Country', ascending = False).head(20)\nquestion_2_2Response","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(10,8))\nplt.xticks(rotation='vertical')\nquestion_2_2Responsefig = sns.barplot(x = 'Response Answer', y= 'City', data = question_2_2Response)\nquestion_2_2Responsefig.set(Title='Top 20 factors that affect (supports/challenges) cities ability to adapt to climate change')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Question 4.0(CITY-WIDE EMISSIONS)- Does your city have a city-wide emissions inventory to report?"},{"metadata":{"trusted":true},"cell_type":"code","source":"question_4 = citiesDataset2019.loc[citiesDataset2019['Question Number']== '4.0']\n\n#question_4['Response Answer'].fillna('No answer')\n#question_4.groupby('Response Answer')['Response Answer'].count()\n\nnotIntending = question_4.loc[question_4['Response Answer']== 'Not intending to undertake']\ninProgress = question_4.loc[question_4['Response Answer']== 'In progress'] \nintending = question_4.loc[question_4['Response Answer']== 'Intending to undertake in the next 2 years']\nyes = question_4.loc[question_4['Response Answer']== 'Yes'] \n\nquestion4_Response = pd.concat([notIntending,inProgress,intending,yes])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(20,18))\nquestion4_Responsefig1 = px.choropleth(question4_Response,  locations= \"Code\", color = 'Response Answer', hover_name= \"City\", scope='world',width=800, height=700, color_continuous_scale= px.colors.sequential.Viridis)\nquestion4_Responsefig1.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Question 6.1(OPPORTUNITIES)- Does your city collaborate in voluntary partnership with businesses in your city on sustainability projects?\n### Question 8.0(ENERGY)- Does your city have a renewable energy or electricity target?"},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"question_6 = citiesDataset2019.loc[citiesDataset2019['Question Number']== '6.1']\nquestion_8 = citiesDataset2019.loc[citiesDataset2019['Question Number']== '8.0']\n\nquestion_6.groupby('Response Answer')['Response Answer'].count(),question_8.groupby('Response Answer')['Response Answer'].count()\n\nquestion6and8 = pd.concat([question_6,question_8])\n\nnotIntending = question6and8.loc[question6and8['Response Answer']== 'Not intending to undertake']\ninProgress = question6and8.loc[question6and8['Response Answer']== 'In progress'] \nintending = question6and8.loc[question6and8['Response Answer']== 'Intending to undertake in the next 2 years']\nyes = question6and8.loc[question6and8['Response Answer']== 'Yes'] \ndoNotKnow = question6and8.loc[question6and8['Response Answer']== 'Do not know'] \n\nquestion6and8_Response = pd.concat([notIntending,inProgress,intending,yes,doNotKnow])","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Interactive map showing cities responses to question 6.1 and question 8.0"},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"question6and8_Responsefig = px.choropleth(question6and8_Response,  locations= \"Code\", color = 'Response Answer', hover_name= \"Country\", scope='world', animation_frame='Question Number',width=800, height=700, color_continuous_scale= px.colors.sequential.Viridis)\nquestion6and8_Responsefig","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Note: Majority cities collaborate with businesses on sustainable projects but most do not have renewable energy or electricity targets yet and many other organisations disclosing for the cities claim not to know of any."},{"metadata":{},"cell_type":"markdown","source":"## Question 10.11(TRANSPORT)- Does your city collect air quality data?\n## Question 14.3(WATER SECURITY)- Are you aware of any substantive current or future risk to your city's water supply?\n\n## Interactive map"},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"question_10 = citiesDataset2019.loc[citiesDataset2019['Question Number']== '10.11']\nquestion_14 = citiesDataset2019.loc[citiesDataset2019['Question Number']== '14.3']\n\n#question_10.groupby('Response Answer')['Response Answer'].count(),question_14.groupby('Response Answer')['Response Answer'].count()\n\nquestion10and14 = pd.concat([question_10,question_14])\n\nno = question10and14.loc[question10and14['Response Answer']== 'No']\nyes = question10and14.loc[question10and14['Response Answer']== 'Yes'] \ndoNotKnow = question10and14.loc[question10and14['Response Answer']== 'Do not know'] \n\nquestion10and14_Response = pd.concat([no,yes,doNotKnow])\n\nquestion10and14_Responsefig = px.choropleth(question10and14_Response,  locations= \"Code\", color = 'Response Answer', hover_name= \"City\", scope='world', animation_frame='Question Number',width=600, height=700, color_continuous_scale= px.colors.sequential.Viridis)\nquestion10and14_Responsefig","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Note: \n### Compared to responses to earlier questions, cities in China as well as cities in most cities within Africa did not respond to question 10.11. Nigeria in particular answered 'yes' to all other questions except question 10.11\n### Cities in America and Canada collect air quality data,however, organisations disclosing are not aware of any risk to their water supply\n### Curitiba in Brazil does not know of if its city collect air quality data, neither does it know of any current of future risk to its city water supply\n### Cities disclosing in some countries(e.g,Venezuela)consistently disclosed either 'intending to...' or 'in progress' for most of the questions\n"},{"metadata":{},"cell_type":"markdown","source":"## Question 14.0(WATER SECURITY) - What are the sources of your city's water?"},{"metadata":{"trusted":true},"cell_type":"code","source":"question_14 = citiesDataset2019.loc[citiesDataset2019['Question Number']== '14.0']\n\nquestion_14groupby = question_14.groupby(['Response Answer'],as_index = False).count()\nquestion_14Response = question_14groupby.sort_values (by = 'Country', ascending = False).head(6)\nquestion_14Response\n\nplt.figure(figsize=(10,8))\nplt.xticks(rotation='vertical')\nquestion_14Responsefig = sns.barplot(x = 'Response Answer', y= 'City', data = question_14Response)\nquestion_14Responsefig.set(Title='Cities water sources')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"surfaceWater = question_14.loc[question_14['Response Answer']== 'Surface water']\ngroundWater = question_14.loc[question_14['Response Answer']== 'Ground water'] \nrainWater = question_14.loc[question_14['Response Answer']== 'Rainwater'] \nrecycled = question_14.loc[question_14['Response Answer']== 'Recycled / reclaimed water']\nother = question_14.loc[question_14['Response Answer']== 'Other source']\n\nquestion_14_Response1 = pd.concat([surfaceWater,groundWater,rainWater,recycled,other])\n\nquestion_14_Response1fig = px.choropleth(question_14_Response1,  locations= \"Code\", color = 'Response Answer', hover_name= \"City\", scope='world', width=800, height=700, color_continuous_scale= px.colors.sequential.Viridis)\nquestion_14_Response1fig","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# USA - SOCIAL VULNERABILITY INDEX (SVI)"},{"metadata":{"trusted":true},"cell_type":"code","source":"socialVulnerabilityData = pd.read_csv('/kaggle/input/cdp-unlocking-climate-solutions/Supplementary Data/CDC Social Vulnerability Index 2018/SVI2018_US_COUNTY.csv')\nsocialVulnerabilityData.groupby('STATE')['STATE'].count()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"socialVulnerabilityDataSum = socialVulnerabilityData.groupby(['STATE'],as_index=False).sum()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### E_POV - Persons below poverty estimate"},{"metadata":{"trusted":true},"cell_type":"code","source":"socialVulnerabilitySTATE_EPOV= socialVulnerabilityDataSum[['STATE','E_POV']]\nsocialVulnerabilitySTATE_EPOV.sort_values(by = 'E_POV', ascending=False)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"#socialVulnerabilitySTATE_EPOV.describe()\n\nplt.figure(figsize=(12,10))\nsocialVulnerabilityDataSumfig1 = sns.lineplot(x = \"STATE\", y = \"E_POV\", data = socialVulnerabilityDataSum)\nplt.xticks(rotation='vertical')\nsocialVulnerabilityDataSumfig1.set(yscale='log')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"#### Notes:\n1. The US state that has the highest number of persons below poverty estimate between year 2014 and 2018 is CALIFORNIA. The total number of these people is 5,487,141\n2. The US state that has the lowest number of persons below poverty estimate between year 2014 and 2018 is WYOMING. The total number of these people is 63,311\n3. The average number of people living below poverty estimate per state in the United State between 2014 and 2018 is 867,566\n4. CALIFORNIA state has 58 counties. It is good to check throughout the counties as well"},{"metadata":{"trusted":true},"cell_type":"code","source":"socialVulnerabilityDataCALIFORNIA = socialVulnerabilityData.loc[socialVulnerabilityData['STATE']=='CALIFORNIA']\nsocialVulnerabilityDataCALIFORNIA_EPOV = socialVulnerabilityDataCALIFORNIA[['STATE','COUNTY','E_POV']]\nsocialVulnerabilityDataCALIFORNIA_EPOV.sort_values(by = 'E_POV', ascending = False)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"socialVulnerabilityDataCALIFORNIA_EPOV.describe()\n\nLA_EPOV = socialVulnerabilityDataCALIFORNIA_EPOV.loc[socialVulnerabilityDataCALIFORNIA_EPOV['COUNTY']== 'Los Angeles']\nLA_EPOV.drop(columns=['STATE'])\ncolumn_names = {'COUNTY':'county_name','E_POV':'population'}\nLA_EPOV = LA_EPOV.rename(columns = column_names)\n\nplt.figure(figsize=(12,10))\nsocialVulnerabilityDataCALIFORNIA_EPOVfig1 = sns.barplot(x = \"COUNTY\", y = \"E_POV\", data = socialVulnerabilityDataCALIFORNIA_EPOV)\nplt.xticks(rotation ='vertical')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Note:\n1. LOS ANGELES county has the highest number of people living below the poverty estimate in CALIFORNIA state\n2. The dataset records 58 counties in California and Los Angeles alone packs 1,589,956 out of the total 5,487,141 individuals living below the poverty estimate\n3. The mean value is 94,605"},{"metadata":{},"cell_type":"markdown","source":"### US population"},{"metadata":{"trusted":true},"cell_type":"code","source":"usState_Population = usCities[['state_name', 'population']]\nusState_Population1 = usState_Population.groupby(['state_name'],as_index = False).sum()\nusState_Pop= usState_Population1.sort_values(by= 'population', ascending = False)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(12,10))\nusState_Popfig1 = sns.barplot(x = \"state_name\", y = \"population\", data = usState_Pop)\nplt.xticks(rotation='vertical')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Comparing Los Angeles population to the below poverty estimate population"},{"metadata":{"trusted":true},"cell_type":"code","source":"usCitiesLA_data = usCities.loc[usCities['county_name'] == 'Los Angeles']\nusCitiesLA_data = usCitiesLA_data[['county_name','population']]\nLA_Population= usCitiesLA_data.groupby(['county_name'],as_index = False).sum()\n\nLA_data_fig = pd.concat({'Total Population': LA_Population.set_index('county_name'), 'Poverty Population': LA_EPOV.set_index('county_name')}, axis=1).plot.bar()\nLA_data_fig.set(title = 'Total Population vs Below poverty Estimate population')\nLA_data_fig.set(yscale='log')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Note:\nThe total population in Los Angeles is a little over 19 million while those living below the poverty estimate are a little over 1.5 million."},{"metadata":{},"cell_type":"markdown","source":"### E_UNEMP - Civillians (age 16+) unemployed estimate"},{"metadata":{"trusted":true},"cell_type":"code","source":"socialVulnerabilitySTATE_EUNEMP= socialVulnerabilityDataSum[['STATE','E_UNEMP']]\n#socialVulnerabilitySTATE_EUNEMP\ne_UNEMP= socialVulnerabilitySTATE_EUNEMP.sort_values(by = 'E_UNEMP', ascending=False)\ne_UNEMP\n\nplt.figure(figsize=(12,10))\ne_UNEMPfig1 = sns.barplot(x = \"STATE\", y = \"E_UNEMP\", data = e_UNEMP)\nplt.xticks(rotation='vertical')\ne_UNEMPfig1.set(yscale='log')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### E_NOHSDP - Pearsons (age 25+) with no high school diploma estimate\n### E_MINRTY - Minority (all persons except white, nonHispanic) estimate\n### E_CROWD - At household level (occupied housing units), more people than room estimate\n### E_NOVEH - Households with no vehicle available estimate"},{"metadata":{"trusted":true},"cell_type":"code","source":"socialVulnerabilitySTATE_ENOHSDP= socialVulnerabilityDataSum[['STATE','E_NOHSDP']]\ne_NOHSDP= socialVulnerabilitySTATE_ENOHSDP.sort_values(by = 'E_NOHSDP', ascending=False)\n\nsocialVulnerabilitySTATE_EMINRTY= socialVulnerabilityDataSum[['STATE','E_MINRTY']]\ne_MINRTY= socialVulnerabilitySTATE_EMINRTY.sort_values(by = 'E_MINRTY', ascending=False)\n\nsocialVulnerabilitySTATE_ECROWD= socialVulnerabilityDataSum[['STATE','E_CROWD']]\ne_CROWD= socialVulnerabilitySTATE_ECROWD.sort_values(by = 'E_CROWD', ascending=False)\n\nsocialVulnerabilitySTATE_ENOVEH= socialVulnerabilityDataSum[['STATE','E_NOVEH']]\ne_NOVEH= socialVulnerabilitySTATE_ENOVEH.sort_values(by = 'E_NOVEH', ascending=False)\n\nplt.rcParams[\"figure.figsize\"] = (20,20)\n\ne_NOHSDP_MINRTY_CROWD_NOVEH = pd.concat({'25+ years with no high school diploma': e_NOHSDP.set_index('STATE'),\n                                         'Minority': e_MINRTY.set_index('STATE'), 'Household, more people than room estimate': e_CROWD.set_index('STATE'),\n                                        'Household with no vehicle': e_NOVEH.set_index('STATE')}, axis=1).plot.bar(width=2,color=['b','g','r','y'])\ne_NOHSDP_MINRTY_CROWD_NOVEH.set(title = 'E_NOHSDP, E_MINRTY, E_CROWD, E_NOVEH indices by State')\ne_NOHSDP_MINRTY_CROWD_NOVEH.legend(loc='center left', bbox_to_anchor=(1.0, 0.5))\ne_NOHSDP_MINRTY_CROWD_NOVEH.set(yscale='log')\n\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Note:\n1. CALIFORNIA state has the highest population, the largest number of *people living below poverty estimate, *civillian 16+ and unemployed, *25+ with no high school diploma, *minority population and *people occupying more than room estimate\n\n2. The number of Minority group for all state is higher than the other indices.\n\n3. New York has the highest number of households with no vehicle"},{"metadata":{},"cell_type":"markdown","source":"# ..."},{"metadata":{},"cell_type":"markdown","source":"\n"}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":4}