{"cells":[{"metadata":{},"cell_type":"markdown","source":"# Introduction"},{"metadata":{},"cell_type":"markdown","source":"**Challenge**"},{"metadata":{},"cell_type":"markdown","source":"This Kaggle analytics challenge consists of exploring and analyzing social and environmental information provided to CDP by disclosing companies and cities in order to help in identifying solutions to tackle climate change impacts.\n\nThe main questions defined by the challenge organizer are:\n\n Helping cities adapt: How do you help cities adapt to a rapidly changing climate in a way that is socially equitable?\n    Cities/corporation cooperation: What are the practical and actionable points where city and corporate ambition join? Where do cities have problems that corporations affected by those problems could solve, and vice-versa?\n    Environmental risks & Social equity: How can we measure the intersection between environmental risks and social equity?\n"},{"metadata":{},"cell_type":"markdown","source":"Goals"},{"metadata":{},"cell_type":"markdown","source":"Calculating KPIs that relate to the environmental and social issues and demonstrating whether city and corporate ambitions take these factors into account\n\n   Leverage external data sources and discuss the intersection between environmental and social issues\n"},{"metadata":{"_uuid":"b5ab01b9-ea45-44b8-9f88-13b53d0dcb5e","_cell_guid":"3c11e52c-c088-42df-a159-c8e21563699a","trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"# standard libs\nimport os\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport re\nimport json\nfrom glob import glob\nfrom tqdm import tqdm\n\n# plotting libs\nimport seaborn as sns\nimport altair as alt\nimport plotly as plotly\nimport plotly.graph_objects as go\nimport plotly.express as px\nfrom plotly.subplots import make_subplots\n\n# geospatial libs\nfrom mpl_toolkits.basemap import Basemap\nfrom shapely.geometry import Polygon\nimport geopandas as gpd\nimport folium\nimport plotly.graph_objects as go\nimport plotly_express as px\n\n# set in line plotly \nfrom plotly.offline import init_notebook_mode;\ninit_notebook_mode(connected=True)\nimport warnings\nwarnings.filterwarnings('ignore')\nfrom difflib import SequenceMatcher\ncolors= ['#003f5c','#2f4b7c','#665191','#a05195','#d45087','#f95d6a','#ff7c43','#ffa600','#fcca46','#a1c181','#619b8a','#386641']\n\nprint(os.getcwd())","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"data_2018 = glob('/kaggle/input/cdp-unlocking-climate-solutions/*/*/2018*.csv')+glob('/kaggle/input/cdp-unlocking-climate-solutions/*/*2018*.csv')\ndata_2019 = glob('/kaggle/input/cdp-unlocking-climate-solutions/*/*/2019*.csv')+glob('/kaggle/input/cdp-unlocking-climate-solutions/*/*2019*.csv')\ndata_2020 = glob('/kaggle/input/cdp-unlocking-climate-solutions/*/*/2020*.csv')+glob('/kaggle/input/cdp-unlocking-climate-solutions/*/*2020*.csv')\ncities_response_files = glob('/kaggle/input/cdp-unlocking-climate-solutions/*/*/*Full_Cities_Dataset.csv')\ncities_disclosing_files = glob('/kaggle/input/cdp-unlocking-climate-solutions/*/*/*Cities_Disclosing_to_CDP.csv')\ncities_disclosing = pd.concat([pd.read_csv(file) for file in cities_disclosing_files])\ncities_response = pd.concat([pd.read_csv(file) for file in cities_response_files])\ncorporate_climate_change_disclosing_files = glob('/kaggle/input/cdp-unlocking-climate-solutions/*/*/*/*Corporates_Disclosing_to_CDP_Climate_Change*.csv')\ncorporate_water_security_disclosing_files = glob('/kaggle/input/cdp-unlocking-climate-solutions/*/*/*/*Corporates_Disclosing_to_CDP_Water_Security*.csv')\ncorporate_climate_change_response_files = glob('/kaggle/input/cdp-unlocking-climate-solutions/*/*/*/*Full_Climate_Change_Dataset*.csv')\ncorporate_water_security_response_files = glob('/kaggle/input/cdp-unlocking-climate-solutions/*/*/*/*Full_Water_Security_Dataset*.csv')\ncorporate_climate_change_disclosing = pd.concat([pd.read_csv(file) for file in corporate_climate_change_disclosing_files])\ncorporate_water_security_disclosing = pd.concat([pd.read_csv(file) for file in corporate_water_security_disclosing_files])\ncorporate_climate_change_response = pd.concat([pd.read_csv(file) for file in corporate_climate_change_response_files])\ncorporate_water_security_response = pd.concat([pd.read_csv(file) for file in corporate_water_security_response_files])","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Here we can see that even if we have the name of the organisation we dont have the name if the cities and the population column too is null . I will show it on the next visualization."},{"metadata":{},"cell_type":"markdown","source":"As we know that putting all comments of 2020,2018,2019 would be a hectic task and it would take up so much time . So I am just visualizing the 2020 data"},{"metadata":{},"cell_type":"markdown","source":"# Cities Disclosing Overview"},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"cities_disclosing_2020=cities_disclosing[cities_disclosing[\"Year Reported to CDP\"] == 2020]","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"_cities_20=cities_disclosing_2020[cities_disclosing_2020[\"CDP Region\"] == \"Latin America\"]","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"cities_disclosing.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"cities_disclx=cities_disclosing[cities_disclosing[\"Population Year\"] < 2017  ]","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"cities_disclx.shape","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = px.sunburst(cities_disclx, path=['Year Reported to CDP','Population Year','CDP Region'], values='Population',\n                  color='Population',\n                  color_continuous_scale='RdBu')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"As we can see here that many regions have reported their population year less than 2017 .\nIn the total data of cities_disclosing of 3 years we can see that 991 cities . It will be more elaborated on the year on year chart below ."},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"fig = px.sunburst(cities_disclosing, path=['Year Reported to CDP','First Time Discloser','CDP Region','Organization'], values='Population',\n                  color='Population',\n                  color_continuous_scale='RdBu')\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"_kg_hide-output":true,"trusted":true},"cell_type":"code","source":"''''Latin America    173    304    187\nNorth America    169    208    184\nEurope           137    182    165\nSE ASIA OCEAN    33     72      51\nAfrica           29     48      22\nEast Asia        23     24      21\nMiddle East      5      15      7\nSouth West Asia  3      8       4'''","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"import plotly.graph_objects as go\n\nmonths = ['Latin America', 'North America', 'Europe', 'South East and Oceania', \n          'Africa', 'East Asia','Middle East','South West Asia']\n\nfig = go.Figure()\nfig.add_trace(go.Bar(\n    x=months,\n    y=[187,184,165,51,22,21,7,4],\n    name='Year_18',\n    marker_color='yellowgreen'\n))\nfig.add_trace(go.Bar(\n    x=months,\n    y=[304, 208,182,72,48,24,15,8],\n    name='Year_19',\n    marker_color='orange'\n))\nfig.add_trace(go.Bar(\n    x=months,\n    y=[173,169,137,33,29,23,5,3],\n    name='Year_20',\n    marker_color='orangered'\n))\n\n# Here we modify the tickangle of the xaxis, resulting in rotated labels.\nfig.update_layout(barmode='group', xaxis_tickangle=-45)\nfig.show()\n\n","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"raw","source":"here we can see that in 2018 there were 641 cities and in 2019 there were 861 cities and in 2020 there were 572 cities.\nWe can see that there were 220 cities that had disclosed last year but this year we saw a decline of 289 cities .  "},{"metadata":{"_kg_hide-input":true,"_kg_hide-output":true,"trusted":true},"cell_type":"code","source":"cities_disclosing['Population'].fillna(0)","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"cities_disclosing_p=cities_disclosing.sort_values('Population',ascending=False)[:2068]\ncities_dp20=cities_disclosing_p[cities_disclosing_p[\"Year Reported to CDP\"] == 2020]\ncities_dp19=cities_disclosing_p[cities_disclosing_p[\"Year Reported to CDP\"] == 2019]\ncities_dp18=cities_disclosing_p[cities_disclosing_p[\"Year Reported to CDP\"] == 2018]","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"fig = make_subplots(rows = 1, cols = 1,\nspecs = [[{'type' : 'choropleth'} for column in np.arange(1)]for row in np.arange(1)],\nsubplot_titles = ['Country V Population'])\nfig.add_trace(go.Choropleth(locations = cities_dp20.Country,\nz = cities_dp20.Population,\nlocationmode = 'country names',\ncolorscale = px.colors.sequential.Viridis),\nrow = 1, col = 1)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"**Points of cities Disclosing**\n1. There are too many irregularities in the data .\n2. Accurate data is not given by many countries , uruguay had given its population as 1 billion\n3. The Population Reported was too old and  some cities gave the same population for all three years like they gave the census of 2010,2011 etc\n4. Many organizations have also reported in their local languages like spanish\n5. We see a huge drop in cities reporting in 2020 it is due to the coronavirus crisis and there is not active participation from many cities with huge participation.\n6. As from many countries the participation rate is too low for regions like Middle East, Asia ,Oceania we cannot give a particular country an overview based on very less cities it it likely going to mislead us .\n7. We must only asses the cities participation and find the similarities between different metropolitians and countys"},{"metadata":{},"cell_type":"markdown","source":"# Cities Response Overview"},{"metadata":{"trusted":true},"cell_type":"code","source":"cities_response.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"cities_response.replace(['NaN'],['None'], inplace=True)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"As of the cities we can see that in all three years latin america has the most population. But why is that have you wondered . As the top 10 most populous countries in the world are \nChina,India,USA,Indonesia,Pakistan,Brazil,Nigeria,Bangladesh,Russia,Mexico"},{"metadata":{},"cell_type":"markdown","source":"Then why this irregularities the problems are that there isnt much reports from populous countries and the population year many countries population census was taken way back . Which makes it difficult to extract . As of latin america they have been updating their population every year and there are a lot of cities participating from that region. Below I will show a year on year participation of countries that have disclosed to CDP."},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"import IPython\nurl = 'https://data.cdp.net/dataset/bh/9wyq-236v/embed?width=800&height=600'\niframe = '<iframe src=' + url + ' width=800 height=650></iframe>'\nIPython.display.HTML(iframe)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"**Above data is of 2020**"},{"metadata":{},"cell_type":"markdown","source":"**From the above pie chart we can see that many cities have not elaborated on their answers which can lead to misunderstanding and confusion . We must have pre given answers like mcq**"},{"metadata":{},"cell_type":"markdown","source":" **And we can also see that most responses were from latin america region and they answered the question in their local language which becomes hard to get a clear perspective**"},{"metadata":{},"cell_type":"markdown","source":"Change the column nan to none of the below visualization cause it is the problem"},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"url = 'https://data.cdp.net/dataset/Response-answer/wrf6-9nbk/embed?width=800&height=600'\niframe = '<iframe src=' + url + ' width=800 height=600></iframe>'\nIPython.display.HTML(iframe)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"def extract_answer(df, question, newColumnName, condition=True):\n    '''\n    Extract answer from the number of question \n    @question: (string) name of the question \n    @newColumnName: (string) column name of the question\n    @condition: (boolen) when the question has several outputs \n    @return: DataFrame\n    '''\n    result_df = df[(df['Question Number'] == question) & condition ][[\"Account Number\",\"Response Answer\"]]\n    result_df.columns = [newColumnName if x=='Response Answer' else x for x in result_df.columns]\n    return result_df","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"**Points of Cities Responses**\n1. The responses have been quite interesting as most responses to strategy related questions were given as question not applicable. Due to this we can't get to know how does the city wants to strategize\n2. The responses have not been elaorated . The comments are 99% null and it is a bad factor\n3. We must tell the cities to give response in english or we must transalate the answers to english for a better understanding"},{"metadata":{},"cell_type":"markdown","source":"Below we are going to see the responses on the cities questionnaire of 2020"},{"metadata":{},"cell_type":"markdown","source":"**Cities Responses by questions**\n"},{"metadata":{},"cell_type":"markdown","source":"1. Projects in which money can be invested and pull the city out of a recession"},{"metadata":{"trusted":true},"cell_type":"code","source":"cities_response_20=cities_response[cities_response[\"Year Reported to CDP\"] == 2020]","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"cities_2020_admin_boundary = extract_answer(cities_response_20,'2.0c','Reason', condition = (cities_response_20['Column Name'] == 'Reason'))\ncities_2020_admin_boundary['Reason'].replace('^(Other).*','Other',regex=True, inplace=True)\ncities_2020_admin_boundary['Reason'].value_counts().plot.pie(textprops={'color':\"w\"},pctdistance=0.7,autopct='%.2f%%',figsize=(6,6),colors=colors, labels=None)\nplt.title(\"Reason for not having a climate assesment \",fontsize=17,ha='left')\nplt.legend(labels=cities_2020_admin_boundary['Reason'].value_counts().index, loc=\"best\",bbox_to_anchor=(1, 0.25, 0.5, 0.5))\nplt.show()\ncities_2020_admin_boundary = extract_answer(cities_response_20,'3.2b','Reason', condition = (cities_response_20['Column Name'] == 'Reason'))\ncities_2020_admin_boundary['Reason'].replace('^(Other).*','Other',regex=True, inplace=True)\ncities_2020_admin_boundary['Reason'].value_counts().plot.pie(textprops={'color':\"w\"},pctdistance=0.7,autopct='%.2f%%',figsize=(6,6),colors=colors, labels=None)\nplt.title(\"Reason for having no published plan for climate change \",fontsize=17,ha='left')\nplt.legend(labels=cities_2020_admin_boundary['Reason'].value_counts().index, loc=\"best\",bbox_to_anchor=(1, 0.25, 0.5, 0.5))\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"We can see that in the response of the climate assesment many cities have answered as question not applicable and the 2nd most respons is the lack of resources/funding . Which ultimately leads that cities with more revenue have more funding"},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"cities_2020_admin_boundary = extract_answer(cities_response_20,'4.12b','Reason', condition = (cities_response_20['Column Name'] == 'Reason'))\ncities_2020_admin_boundary['Reason'].replace('^(Other).*','Other',regex=True, inplace=True)\ncities_2020_admin_boundary['Reason'].value_counts().plot.pie(textprops={'color':\"w\"},pctdistance=0.7,autopct='%.2f%%',figsize=(6,6),colors=colors, labels=None)\nplt.title(\"Reason for why city wide emmisions aren't verified \",fontsize=17,ha='left')\nplt.legend(labels=cities_2020_admin_boundary['Reason'].value_counts().index, loc=\"best\",bbox_to_anchor=(1, 0.25, 0.5, 0.5))\nplt.show()\ncities_2020_admin_boundary = extract_answer(cities_response_20,'5.0e','Reason', condition = (cities_response_20['Column Name'] == 'Reason'))\ncities_2020_admin_boundary['Reason'].replace('^(Other).*','Other',regex=True, inplace=True)\ncities_2020_admin_boundary['Reason'].value_counts().plot.pie(textprops={'color':\"w\"},pctdistance=0.7,autopct='%.2f%%',figsize=(6,6),colors=colors, labels=None)\nplt.title(\"Reason for having no climate reduction target \",fontsize=17,ha='left')\nplt.legend(labels=cities_2020_admin_boundary['Reason'].value_counts().index, loc=\"best\",bbox_to_anchor=(1, 0.25, 0.5, 0.5))\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Here also the verification of the data is not seriously taken by many cities which is bad . The reason for having no published plan too is demotivating"},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"cities_2020_admin_boundary = extract_answer(cities_response_20,'5.5b','Reason', condition = (cities_response_20['Column Name'] == 'Reason'))\ncities_2020_admin_boundary['Reason'].replace('^(Other).*','Other',regex=True, inplace=True)\ncities_2020_admin_boundary['Reason'].value_counts().plot.pie(textprops={'color':\"w\"},pctdistance=0.7,autopct='%.2f%%',figsize=(6,6),colors=colors, labels=None)\nplt.title(\"Reason for not having mitigation plan \",fontsize=17,ha='left')\nplt.legend(labels=cities_2020_admin_boundary['Reason'].value_counts().index, loc=\"best\",bbox_to_anchor=(1, 0.25, 0.5, 0.5))\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"cities_2020_admin_boundary = extract_answer(cities_response_20,'8.0b','Reason', condition = (cities_response_20['Column Name'] == 'Reason'))\ncities_2020_admin_boundary['Reason'].replace('^(Other).*','Other',regex=True, inplace=True)\ncities_2020_admin_boundary['Reason'].value_counts().plot.pie(textprops={'color':\"w\"},pctdistance=0.7,autopct='%.2f%%',figsize=(6,6),colors=colors, labels=None)\nplt.title(\"Reason for not having a renewable energy target \",fontsize=17,ha='left')\nplt.legend(labels=cities_2020_admin_boundary['Reason'].value_counts().index, loc=\"best\",bbox_to_anchor=(1, 0.25, 0.5, 0.5))\nplt.show()\ncities_2020_admin_boundary = extract_answer(cities_response_20,'8.5b','Reason', condition = (cities_response_20['Column Name'] == 'Reason'))\ncities_2020_admin_boundary['Reason'].replace('^(Other).*','Other',regex=True, inplace=True)\ncities_2020_admin_boundary['Reason'].value_counts().plot.pie(textprops={'color':\"w\"},pctdistance=0.7,autopct='%.2f%%',figsize=(6,6),colors=colors, labels=None)\nplt.title(\"Reason for having no energy efficiency target \",fontsize=17,ha='left')\nplt.legend(labels=cities_2020_admin_boundary['Reason'].value_counts().index, loc=\"best\",bbox_to_anchor=(1, 0.25, 0.5, 0.5))\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"In the mitigation,climate,renewable energy pie charts we can see that many cities projects are still in development if we try to see the year on year response answers based on different organizations . That how many cities are really taking action."},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"cities_2020_admin_boundary = extract_answer(cities_response_20,'14.2b','Reason', condition = (cities_response_20['Column Name'] == 'Reason'))\ncities_2020_admin_boundary['Reason'].replace('^(Other).*','Other',regex=True, inplace=True)\ncities_2020_admin_boundary['Reason'].value_counts().plot.pie(textprops={'color':\"w\"},pctdistance=0.7,autopct='%.2f%%',figsize=(6,6),colors=colors, labels=None)\nplt.title(\"Why dont cities consider them to be exposed to a substantive water risk\",fontsize=17,ha='left')\nplt.legend(labels=cities_2020_admin_boundary['Reason'].value_counts().index, loc=\"best\",bbox_to_anchor=(1, 0.25, 0.5, 0.5))\nplt.show()\ncities_2020_admin_boundary = extract_answer(cities_response_20,'14.4b','Reason', condition = (cities_response_20['Column Name'] == 'Reason'))\ncities_2020_admin_boundary['Reason'].replace('^(Other).*','Other',regex=True, inplace=True)\ncities_2020_admin_boundary['Reason'].value_counts().plot.pie(textprops={'color':\"w\"},pctdistance=0.7,autopct='%.2f%%',figsize=(6,6),colors=colors, labels=None)\nplt.title(\"Reason for not having a water resource strategy \",fontsize=17,ha='left')\nplt.legend(labels=cities_2020_admin_boundary['Reason'].value_counts().index, loc=\"best\",bbox_to_anchor=(1, 0.25, 0.5, 0.5))\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Now we are going to look into opportunities"},{"metadata":{"trusted":true},"cell_type":"code","source":"cities_2020_admin_boundary = extract_answer(cities_response_20,'0.1','Administrative boundary', condition = (cities_response_20['Column Name'] == 'Administrative boundary'))\ncities_2020_admin_boundary['Administrative boundary'].replace('^(Other).*','Other',regex=True, inplace=True)\ncities_2020_admin_boundary['Administrative boundary'].value_counts().plot.pie(textprops={'color':\"w\"},pctdistance=0.7,autopct='%.2f%%',figsize=(6,6),colors=colors, labels=None)\nplt.title(\"Administrative Boundary Distribution \",fontsize=17,ha='left')\nplt.legend(labels=cities_2020_admin_boundary['Administrative boundary'].value_counts().index, loc=\"best\",bbox_to_anchor=(1, 0.25, 0.5, 0.5))\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"worldcities = pd.read_csv('/kaggle/input/world-cities/worldcities.csv').rename(columns={'country':'Country'})\nworldcities['Country'].replace(['Bolivia','Hong Kong','Côte D’Ivoire','Congo (Kinshasa)',\n                               'Korea, South','Moldova','Russia','West Bank','Taiwan','United Kingdom','Tanzania',\n                                'United States','Venezuela','Vietnam'                                \n                               ],\n                               \n                               \n                              ['Bolivia (Plurinational State of)',\n 'China, Hong Kong Special Administrative Region',                              \n \"Côte d'Ivoire\",\n 'Democratic Republic of the Congo',\n 'Republic of Korea',\n 'Republic of Moldova',\n 'Russian Federation',\n 'State of Palestine',\n 'Taiwan, Greater China',\n 'United Kingdom of Great Britain and Northern Ireland',\n 'United Republic of Tanzania',\n 'United States of America',\n 'Venezuela (Bolivarian Republic of)',\n 'Viet Nam'],\n                              inplace=True)\n\nworldcities = worldcities.merge(cities_response[['Country','CDP Region']].drop_duplicates(),on='Country',how='left')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_kg_hide-output":true,"_kg_hide-input":true},"cell_type":"code","source":"import plotly.express as px \nimport numpy as np\nfig = px.sunburst(cities_disclosing_2020, path=['CDP Region','Country','Organization'], values='Population',\n                  color='Population', hover_data=['Organization'],\n                  color_continuous_scale='RdBu',\n                  color_continuous_midpoint=np.average(cities_disclosing_2020['Population'], weights=cities_disclosing_2020['Population']))\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"**Suggestions for the cdp team**\n1. Verify the data and translate local languages into english\n2. See the year on year charts . for example many cities have responded saying target still in development all three years.\n3. There are a lot of individual responses for a question . Which is not nice rather than elaborating in comments they elaborated about it in the response answer.\n4. Add more columns like city gdp,per capita income and city revenue and their spending \n5. Also put a political stability score . Because in less developed cities authorities usually try to take advantage of the money that was given to do a project .\n6. As of climate security and water security develop a score for which countries have stricter rules on climate and water security . And are they really helpful\n7. Love the initiative of keeping an analytics competition I learned so much through this competition and love your company agenda too ."}],"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}