In [9]:
'''Script that selects fires with intensity over 50 and saves the locations to the csv file
We use fires with intensity over 50 in order to shrink our dataset and make it run faster '''
import pandas as pd
In [8]:
#read the original file
fname = 'hotspot_2015'
fire = pd.read_csv(fname+".csv", parse_dates=['datetime'], usecols=['latitude','longitude','datetime', 'power'])
print(fire.shape)
fire.head()
Out[8]:
In [30]:
#select only fires with intencities greater than 50
fire=fire.dropna()
fire50=fire.drop(fire[fire.power<=50].index)
print(fire50.shape)
In [31]:
#save trimmed dataset into csv
fnamesave = 'hotspot_2015_power50.csv'
pd.DataFrame.to_csv(fire50,fnamesave)