# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab.research.google.com/github/kvinne-anc/Conflict-and-Climate-Project/blob/main/Asia_Conflict_Temp_DataExploration.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

# + id="ssmFO_5O4Va2"
import pandas as pd 
import numpy as np 


# + id="rN596JpK4aYH" colab={"base_uri": "https://localhost:8080/", "height": 618} outputId="503bd662-028d-479c-bc37-c16bb729cecb"
conflict = pd.read_csv('/content/asia_conflicts[1].csv')
conflict.head()

# + id="zKsT14KB9eUU" colab={"base_uri": "https://localhost:8080/", "height": 50} outputId="64589a97-fdaf-4bf1-a2fa-3f9fdff0156a"
conflict['country'].values


# + id="sYpJcdFnCQU2" colab={"base_uri": "https://localhost:8080/", "height": 1000} outputId="1bc6ae1f-596f-447d-e4e1-c6894f24399a"
conflict = conflict[conflict.country != 'Thailand']
conflict

# + id="eweLRUwj5m1J" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="bf037eb9-476a-4f05-cbf3-3e8771ac6de5"
conflict.shape


# + id="k_SIgUlG5rad" colab={"base_uri": "https://localhost:8080/", "height": 538} outputId="631c842d-8a82-4ee6-c570-1de94228373a"
conflict.isnull().sum()

# + id="-3rOj1GEKDdT" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="d21bf666-68ce-4382-8aef-77f1d17fcf5b"
conflict['location'].nunique()

# + id="965gl8WNKDgx" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="2cf2917d-7638-405e-a52a-4b4493daaeab"
conflict['event_date'].nunique()

# + id="C1UQ0aTHKYJ-" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="82096bef-413a-4dfc-8229-435ff3d170de"
conflict['year'].nunique()

# + id="pzwEY17oKm8-"
#Conflict dataset runs from 2010-2018, contains long/lat
#Temp by City dataset runs from 1743-2013: No other viable datasets could be found for monthly temp by city from 2013-2018
#contains long/lat
#Braith conflict dataset runs from 1990-2001, contains date and long/lat
#Forgotten conflicts dataset runs from various dates depnding on location to present 
#Asia conflicts has the day, month year for conflicts, can change the dt format, drop the day, keep month and year - supplement missing years
#from 2001-2010 with forgotten conflicts data. Add extra rows for months during ongoing conflict to supplement. 
#Trim all datasets down by specific lat/long after rounding, and specific years after that. 

# + id="Lc-vkckAKnN8"


# + id="HYxq3DUpHG3I" colab={"base_uri": "https://localhost:8080/", "height": 195} outputId="7be6def2-24cc-4d6e-98c2-e4378ea2c47f"
temp = pd.read_csv('/content/GlobalLandTemperaturesByCity[1].csv')
temp.head()

# + id="6Z8Td6VPHG6Z" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="e9713cfa-f13b-4b04-dab7-dfe7008b3627"
temp.shape

# + id="4HYxJWevHG94" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="a50df555-77bd-4f6d-eae6-ff49b44f8319"
temp['City'].nunique()

# + id="v-8_XBBaH92f" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="229bd564-ee69-4c14-aef6-b203a9b2dbc9"
temp['Country'].nunique()

# + id="cte38nHlIC4J" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="3f73f1af-e76e-4b09-bc1d-a931c172c2e8"
temp['dt'].nunique()

# + id="xELBfVH6IGpL" colab={"base_uri": "https://localhost:8080/", "height": 195} outputId="7e7323a2-27f3-4290-a771-9248f2a9e928"
temp.tail()

# + id="RidpvOlzIN7J"
import pandas as pd

# + id="7tw3IdsZpk1K" colab={"base_uri": "https://localhost:8080/", "height": 195} outputId="058c84ca-113f-451b-d876-0cad8b8a9f55"
Braith = pd.read_excel('/content/Braith_II2005_data.xls')
Braith.head()

# + id="ON-7403Tp5Wv" colab={"base_uri": "https://localhost:8080/", "height": 195} outputId="f2c371d6-2b3d-489c-9765-337f0e9f45b8"
Braith.tail()

# + id="4DfQJJecqHQ7"


StarcoderdataJupyterScriptsDedupFiltered