{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":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\nimport numpy as np # linear algebra\nimport 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\nimport os\nfor 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":"# Corporate Data"},{"metadata":{"trusted":true},"cell_type":"code","source":"main_dir='/kaggle/input/cdp-unlocking-climate-solutions'\ndir_list=os.listdir(main_dir)\ncorp_dir=os.path.join(main_dir,dir_list[0])\nsup_dir=os.path.join(main_dir,dir_list[1])\ncities_dir=os.path.join(main_dir,dir_list[2])\n\ncorp_list=os.listdir(corp_dir)\ncorp_res_dir=os.path.join(corp_dir,'Corporations Responses')\ncorp_ques_dir=os.path.join(corp_dir,'Corporations Questionnaires')\ncorp_dis_dir=os.path.join(corp_dir,'Corporations Disclosing')\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"ws='Water Security'\ncc='Climate Change'","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"corp_res_cc=os.path.join(corp_res_dir,cc)\nos.listdir(corp_res_cc)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","trusted":true},"cell_type":"code","source":"cor_cc_20=pd.read_csv(os.path.join(corp_res_cc,'2020_Full_Climate_Change_Dataset.csv'))\ncor_cc_20.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"cor_cc_20.submission_date=pd.to_datetime(cor_cc_20.submission_date)\ncor_cc_20.submission_date\ncor_cc_20['submission_year']=cor_cc_20.submission_date.dt.year\ncor_cc_20['submission_month']=cor_cc_20.submission_date.dt.month\ncor_cc_20['submission_day']=cor_cc_20.submission_date.dt.day","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"import matplotlib.pyplot as plt","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(15,10))\ncor_cc_20.groupby('organization')['module_name'].count().sort_values(ascending=False)[:20].plot(kind='barh')\nplt.xlabel('count of modules')\nplt.show()\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(15,10))\ncor_cc_20.groupby('submission_month')['response_value'].count().sort_values(ascending=True).plot(kind='barh')\nplt.xlabel('countof responses')\nplt.show()\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(15,10))\ncor_cc_20.groupby('submission_day')['response_value'].count().sort_values(ascending=True).plot(kind='barh')\nplt.xlabel('countof responses')\nplt.show()\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(15,10))\ncor_cc_20.groupby('module_name')['question_number'].count().sort_values(ascending=True).plot(kind='barh')\nplt.xlabel('count of questions')\nplt.show()\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(25,15))\ncor_cc_20.groupby('question_unique_reference')['response_value'].count().sort_values(ascending=True).plot(kind='barh')\nplt.xlabel('count of responses')\nplt.ylabel('question_unique_reference')\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"cor_cc_20.question_unique_reference.nunique()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"cities_20=pd.read_csv('/kaggle/input/cdp-unlocking-climate-solutions/Cities/Cities Responses/2020_Full_Cities_Dataset.csv')\ncities_20.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(20,10))\ncities_20.groupby('Question Name').nunique()['Response Answer'].sort_values(ascending=False)[:50].plot(kind='bar')\nplt.ylabel('Count of response')\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"plt.figure(figsize=(20,15))\nax1=plt.subplot(121, aspect='equal')\ncount_org_per_region=cities_20.groupby('CDP Region')['Organization'].count()\ncount_org_per_region.plot(kind='pie',ax=ax1,autopct='%1.1f%%')\nplt.title('Count of organization by CDP region')\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"In Progess"},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"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}