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()


(444900, 4)
Out[8]:
latitude longitude datetime power
0 -15.0460 144.3795 2015-01-01 01:04:50 14.2
1 -15.8927 136.6096 2015-01-01 01:00:50 11.9
2 -17.1466 145.8501 2015-01-01 01:00:50 10.0
3 -18.0796 122.6971 2015-01-01 02:41:30 11.1
4 -18.0764 122.6902 2015-01-01 02:45:40 11.0

In [30]:
#select only fires with intencities greater than 50
fire=fire.dropna() 
fire50=fire.drop(fire[fire.power<=50].index)

print(fire50.shape)


(33122, 4)

In [31]:
#save trimmed dataset into csv
fnamesave = 'hotspot_2015_power50.csv'
pd.DataFrame.to_csv(fire50,fnamesave)