In [2]:
import sys
import pandas as pd
import numpy as np
import json
import matplotlib.pyplot as plt
import seaborn as sns
from pathlib import Path

sns.set(style="white")

#pd.set_option("display.max_rows",6)

%matplotlib inline

In [3]:
# analysis of entire data set - collected using varsomdata2.varsomscripts.avalanchewarningscomplete.get_season_17_18()
data_pth = Path(r'D:\Dev\varsomdata2\localstorage\aval_incidents_2013_2019.csv')

inc_df = pd.read_csv(data_pth, index_col=0)
inc_df.head()


Out[3]:
ActivityInfluencedName ActivityInfluencedTID CompetenceLevelName DamageExtentName DamageExtentTID DtObsTime DtRegTime ForecastRegionName ForecastRegionTID GeoHazardName ... Longitude MunicipalName NickName ObserverId RegID RegistrationName RegistrationTID UTMEast UTMNorth UTMZone
index
0 Topptur 111 Ukjent Påvirket ingenting 10 2013-01-20 11:15:00+01:00 2013-01-21 08:43:14+00:00 Indre Troms 3013 Snø ... 19.815385 BALSFJORD magkjeld@regobsTroms 498 5061 Ulykke/hendelse 11 690714 7683582 33
1 Hus 160 *** Kun materielle skader 20 2013-01-21 06:30:00+01:00 2013-01-25 10:16:36+00:00 Indre Troms 3013 Snø ... 19.760810 BALSFJORD Ragnar@NVE 6 5474 Ulykke/hendelse 11 688532 7683725 33
2 Fjellskitur 114 Ukjent Påvirket ingenting 10 2013-01-22 19:21:00+01:00 2013-01-22 21:29:37+00:00 Svartisen 3017 Snø ... 14.217975 RANA Ukjent observatør 0 5254 Ulykke/hendelse 11 465128 7369823 33
3 Topptur 111 Ukjent Påvirket ingenting 10 2013-01-23 20:00:00+01:00 2013-01-25 12:25:57+00:00 Tromsø 3011 Snø ... 18.745638 TROMSØ Ukjent observatør 0 5509 Ulykke/hendelse 11 644894 7737784 33
4 Ski offpist 113 **** Nestenulykke 29 2013-01-28 20:00:00+01:00 2013-01-29 07:25:05+00:00 Tromsø 3011 Snø ... 19.061126 TROMSØ Karsten@NVE 49 5878 Ulykke/hendelse 11 657417 7733551 33

5 rows × 28 columns


In [4]:
inc_df.columns


Out[4]:
Index(['ActivityInfluencedName', 'ActivityInfluencedTID',
       'CompetenceLevelName', 'DamageExtentName', 'DamageExtentTID',
       'DtObsTime', 'DtRegTime', 'ForecastRegionName', 'ForecastRegionTID',
       'GeoHazardName', 'GeoHazardTID', 'IncidentHeader', 'IncidentIngress',
       'IncidentText', 'LangKey', 'Latitude', 'LocationID', 'LocationName',
       'Longitude', 'MunicipalName', 'NickName', 'ObserverId', 'RegID',
       'RegistrationName', 'RegistrationTID', 'UTMEast', 'UTMNorth',
       'UTMZone'],
      dtype='object')

In [5]:
inc_df['DtObsTime'][0][:4]


Out[5]:
'2013'

In [6]:
inc_df['year'] = inc_df.apply(lambda d: int(d['DtObsTime'][:4]), axis=1)

In [7]:
inc_df.groupby(['year']).count()
#plt.plot(inc_df['DtObsTime'], inc_df['GeoHazardTID'])


Out[7]:
ActivityInfluencedName ActivityInfluencedTID CompetenceLevelName DamageExtentName DamageExtentTID DtObsTime DtRegTime ForecastRegionName ForecastRegionTID GeoHazardName ... Longitude MunicipalName NickName ObserverId RegID RegistrationName RegistrationTID UTMEast UTMNorth UTMZone
year
2013 100 100 100 100 100 100 100 100 100 100 ... 100 95 100 100 100 100 100 100 100 100
2014 55 55 55 55 55 55 55 55 55 55 ... 55 55 55 55 55 55 55 55 55 55
2015 309 309 309 309 309 309 309 309 309 309 ... 309 304 309 309 309 309 309 309 309 309
2016 351 351 351 351 351 351 351 351 351 351 ... 351 346 351 351 351 351 351 351 351 351
2017 353 353 353 353 353 353 353 353 353 353 ... 353 352 353 353 353 353 353 353 353 353
2018 392 392 392 392 392 392 392 390 392 392 ... 392 387 392 392 392 392 392 392 392 392
2019 380 380 380 380 380 380 380 380 380 380 ... 380 377 380 380 380 380 380 380 380 380

7 rows × 28 columns


In [ ]: