{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Importing Libraries**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "import statsmodels.api as sm\n",
    "import datetime as datetime"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Preprocessing**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Aggregating over Sammonpuistikko\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Albertinkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Arabiankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Piispanportti\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Marian sairaala\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Perämiehenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Töölönlahdenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Koskelantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Päijänteentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lintulahdenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kansallismuseo\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Laulurastaantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kaivopuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Jämeräntaival\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Niittykumpu (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Toppelundinportti\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Näkinsilta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kutsuntatie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Muurarinkuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Urheilupuisto (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Matinkyläntie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Gyldenintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hauenkalliontie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kössi Koskisen aukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Fleminginkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hakaniemi (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kauppakorkeakoulu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Nordenskiöldinaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Munkkiniemen aukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mamsellimyllynkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hietalahdentori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Karhupuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Matinkartanontie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Rautatientori / länsi\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lauttasaarensilta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Rautatientori / itä\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Itälahdenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Marjaniementie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Komeetankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Piispankallio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ympyrätalo\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lystimäki\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Toinen linja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lastenlehto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vuosaaren puistopolku\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kaivonkatsojanpuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Niittymaa\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vallipolku\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Etuniementie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pitäjänmäen asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Sompasaari\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Erottajan aukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kuikkarinne\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lystimäensilta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Olympiastadion\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Apollonkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Töölöntulli\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Jätkäsaarenlaituri\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Reiherintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kamppi (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Töölönkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Välimerenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kuusitie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kalasatama (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Sumukuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Intiankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kiasma\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Baana\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Haukilahdenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Varustuksentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pajupillintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tilkanvierto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lauttasaaren ostoskeskus\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pasilan asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vanha kirkkopuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Siilitie 13\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Bermudankuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Betonimies\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Haapaniemenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vilhonvuorenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Heikkiläntie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Siilitie 9\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Jalavatie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mäntyviita\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Muusantori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Eteläinen Hesperiankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Korjaamo\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Puotinkylän kartano\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vallilan varikko\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Muotoilijankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Aurinkotuulenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Linnanmäki\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pajamäki\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Messeniuksenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Eläinmuseo\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mannerheimintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pohjois-Haagan asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ida Aalbergin tie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kustaankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tollinpolku\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Venttiilikuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Syystie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Töölönlahden puisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Porolahden koulu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Relanderinaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Käpyläntie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Brahen kenttä\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pernajantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Oravannahkatori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tontunmäentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Viiskulma\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Brahen puistikko\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Orpaanporras\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Otsolahti\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Peukaloisentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kalkkihiekantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Varsapuistikko\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Narinkka\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Töölöntori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Itäkeskus (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Merihaka\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ulappasilta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Painiitty\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hankasuontie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Munkkivuoren ostoskeskus\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Isoisänsilta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Laivalahden puistotie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Haakoninlahdenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Halkaisijantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vanha Kauppahalli\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Liisanpuistikko\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kaisaniemenpuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Myllypuro (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tapionaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Väärämäentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Paavalinpuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Laajalahden aukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vanha Viertotie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Porthania\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Verkatehtaanpuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Annankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Länsisatamankuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Otaranta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Louhentori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kiskontie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Esterinportti\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Herttoniemi (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mikkolantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Urhea-kampus\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Huovitie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Suurpellonaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Jäähalli\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Viikin tiedepuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Arabian kauppakeskus\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Rastila (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kivikonlaita\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tietäjä\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Leikosaarentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hauenkallio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pohjolanaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mastokatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ooppera\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pohjankulma\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Länsituuli\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Itämerentori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Merisotilaantori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Laajasalon ostoskeskus\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Eränkävijäntori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kustaankartano\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ritarikatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Viljelijäntie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Olarinluoma\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kylävoudintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Maistraatintori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Laivasillankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Gebhardinaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Rummunlyöjänkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Länsisatamankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Velodrominrinne\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Aalto-yliopisto (M), Korkeakouluaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kalevalantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Saniaiskuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Katariina Saksilaisen katu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Siilitie (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Juhana Herttuan tie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Agronominkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kauppakeskus Columbus\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Laajalahden keskus\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tenholantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Maunula\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Huopalahdentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Voikukantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vesakkotie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kriikunakuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Rajasaarentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Designmuseo\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Punakiventie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mestarinkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kesäkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Koskelan varikko\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pohjolankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Westendinasema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Halmetie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Friisilänaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Aurinkolahdenaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Rautatieläisenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kontula (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hernepellontie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hakalehto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Käpylän asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kaapelitehdas\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Suomenlahdentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Läkkitori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mellunmäki (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mäkelänkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Haagan tori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tyynenmerenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Unioninkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Paloheinäntie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lukutori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Heikkilänaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Sepänkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Metsänneidonpolku\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Malminkartanon asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Postipuun koulu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tilkantori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Piispansilta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Keilaniemi (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ulvilantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Haapasaarentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Korppaanmäentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Meri-Rastilan tori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Verkkosaari\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lokitie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Diakoniapuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kapteeninpuistikko\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kauppakeskus Kaari\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Komentajankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tapiolan urheilupuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Karhulantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pihlajamäki\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Nelikkotie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Teurastamo\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Toppelundintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kalevankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Otto Brandtin tie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Puistokaari\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vallikatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Postipuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ruskeasuon varikko\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Marjaniemi\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Agnetankuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Huopalahden asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hernesaarenranta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ramsinniementie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kivikonkaari\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lepolantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Säterinniitty\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vähäntuvantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Petter Wetterin tie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Säterinrinne\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kanavaranta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Cygnaeuksenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Puotila (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Siltavoudintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tekniikantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tunnelitie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ala-Malmin tori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hanasaari\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hertanmäenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Thalianaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Paciuksenkaari\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Opastinsilta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Leppävaarankäytävä\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kalkkipellonmäki\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ratapihantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Radiokatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Arielinkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Sörnäinen (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ruomelantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lehtisaarentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Luoteisväylä\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Golfpolku\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Sofianlehdonkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tuohipolku\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kivikon liikuntapuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ratsutori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kulttuuriaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Puotinharju\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Torpparinmäentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Margareetankuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Asentajanpuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vuosaaren liikuntapuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Herttoniemenranta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ilmalan asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Leppävaaranaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Sateentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Eteläesplanadi\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Humalniementie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kannelmäen liikuntapuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Senaatintori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Auringonkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Koukkusaarentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Jännetie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Käskynhaltijantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Sateenkaarentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Valimotie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Aalto-yliopisto (M), Tietotie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kulosaari (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tulisuontie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Melkonkuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Elimäenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Yhdyskunnankuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Teollisuuskatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Von Daehnin katu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ruutikatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kaustisentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Jokipellontie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mellstenintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Rapakiventie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Seurasaari\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pukinmäen liikuntapuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tiistiläntie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pukinmäen asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Sinkilätie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Malmin asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Huhtakuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tupasaarentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Saunalahdentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Koivusaari (M)\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Haukilahdenaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Takomotie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Teerisuontie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ajomiehentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Keilaranta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Töyrynummi\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Aulangontie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Linnakepolku\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kasarmitori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Salmisaarenranta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Majurinkulma\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mustikkamaa\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Puistolan asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vihdintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Viikin normaalikoulu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Valimon asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Meilahden sairaala\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Itäportti\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Sähkömies\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Leppäsuonaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Herttoniemen kirkko\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kontulankaari\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Matinlahdenranta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Trumpettikuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Honkasuo\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Paloheinän kirjasto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Abraham Wetterin tie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Oulunkylän asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Puotilan ostoskeskus\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mosaiikkitori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kannelmäen asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Eerikinkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pirkkolan liikuntapuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Länsiterminaali\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Sallatunturintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Torpanranta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tammisalon aukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Stenbäckinkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Leppävaaran uimahalli\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hietaniemenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Revontulentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ahertajantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Westendintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Näyttelijäntie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Marttila\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Karviaistie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Nuottaniementie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Puotilantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Elfvik\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kuunkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Karhusuontie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Roihupelto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over A.I. Virtasen aukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Sepetlahdentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Prinsessantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Teljäntie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Itäkeskus Metrovarikko\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Humikkalankuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Savela\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Paloheinän maja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tuukkalantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tiistinkallio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vanha Tapanilantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Haukilahdensolmu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Uimastadion\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kirkkoherrantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kuninkaantammi\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hakuninmaa\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hämeenlinnanväylä\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Alakiventie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Malmin sairaala\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Etupellonpuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kuusisaari\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Säteri\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Koivu-Mankkaa\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Helluntairaitti\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mäkitorpantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Töyrynummentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hagalundinpuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Haukilahdenranta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ehrenströmintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Purjetie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Gunillantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Linnuntie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Maarinranta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Isosaarentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mäkkylän asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kalannintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Orionintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Piikintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Innopoli\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kurkimäentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Maununneva\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mankkaanaukio\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kotinummentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Korkeasaari\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lettopolku\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Puistolantori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Upseerinkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Derby Business Park\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Siltamäki\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Jollas\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Workshop Helsinki\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mankkaanlaaksontie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Gransinmäki\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Keilalahti\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Puistolan VPK\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lallukankuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tapanilan asema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Jakomäentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Maatullinkuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Outotec\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tilketori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Vartioharjuntie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Alppikylä\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Avaruuskatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Nokkala\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Gallen-Kallelan tie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Malminkartanonhuippu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Leppävaaran urheilupuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kurkimäki\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Rukatunturintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kurkijoentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tuulimäki\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Porvarintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Jakomäki\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Paciuksenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Heikinlaakso\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Koetilankuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over  Pop-Up Kansalaistori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Sörnäisten metroasema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Museokatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kampin metroasema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hakaniemen metroasema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Eiran Sairaala\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kauppatori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Erottaja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over nan\n",
      "Writing aggregated dataframe to .csv...\n",
      "Failed to write nan due to 'float' object has no attribute 'replace'\n",
      "Aggregating over Hollolantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kirjurinkuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lumivaarantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kalasataman metroasema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Hylkeenpyytäjänkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Messitytönkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kaironkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Cygnauksenkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Marian Sairaala\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Porkkalankatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Veturitori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Mäntytie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kalastajantie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lintumetsä\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over  Relay Box test station\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kauppakartanonkuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Armas Launiksen katu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Workshop Konala\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Tiurintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over O'Bike Station\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ruomelantie***\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Leiritori\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Adjutantinkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Lahnalahdentie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Professorintie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Niemenmäenkuja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Olarinkatu\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Ulvilanpuisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Friisinkalliontie\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Workshop Smoove\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over 999 Pop-Up Stadin Ammattiopisto\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over 9 Station Test\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over 09 Erottaja\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Herttoniemen ranta\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Puotilan metroasema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Kulosaaren metroasema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Myllypuron metroasema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Herttoniemen metroasema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Itäkeskuksen metroasema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Siilitien metroasema\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over Pop-Up Jätkäsaari\n",
      "Writing aggregated dataframe to .csv...\n",
      "Aggregating over  Kirjurinkuja\n",
      "Writing aggregated dataframe to .csv...\n"
     ]
    }
   ],
   "source": [
    "from os import listdir\n",
    "\n",
    "weather_df = pd.read_csv('datasets/weather_hourly_helsinki.csv', header=2)\n",
    "bike_df = pd.DataFrame(columns=['Departure', 'Return', 'Departure station id', 'Departure station name', 'Return station id', 'Return station name', 'Covered distance (m)', 'Duration (sec.)'])\n",
    "\n",
    "print('Loading datasets...')\n",
    "for dataset in listdir('datasets'):\n",
    "  if dataset == 'weather_hourly_helsinki.csv' or dataset == 'full_bike_data.csv' or dataset.endswith('.gz'):\n",
    "    continue\n",
    "  temp_df = pd.read_csv('datasets/' + dataset, low_memory=False)\n",
    "  bike_df = pd.concat([bike_df, temp_df])\n",
    "\n",
    "bike_df['Departure'] = pd.to_datetime(bike_df['Departure'], format='mixed')\n",
    "bike_df['Return'] = pd.to_datetime(bike_df['Return'], format='mixed')\n",
    "bike_df.to_csv('datasets/full_bike_data.csv')\n",
    "\n",
    "for station in bike_df['Departure station name'].unique():\n",
    "  print(f'Aggregating over {station}')\n",
    "  columns = ['Departure', 'Departure station name', 'Departure station id']\n",
    "  temp_station = bike_df.loc[bike_df['Departure station name'] == station, columns]\n",
    "  temp_station['trip'] = 1\n",
    "\n",
    "  temp_station = temp_station.resample('h', on='Departure').trip.sum()\n",
    "\n",
    "  print('Writing aggregated dataframe to .csv...')\n",
    "  try:\n",
    "    name = station.replace('/', '-')\n",
    "    temp_station.to_csv('datasets/' + name + '_hourly_aggregate.csv', mode='x')\n",
    "  except Exception as e:\n",
    "    print(f'Failed to write {station} due to {e}')\n",
    "\n",
    "for station in bike_df['Return station name'].unique():\n",
    "  print(f'Aggregating over {station}')\n",
    "  columns = ['Return', 'Return station name', 'Return station id']\n",
    "  temp_station = bike_df.loc[bike_df['Return station name'] == station, columns]\n",
    "  temp_station['trip'] = 1\n",
    "\n",
    "  temp_station = temp_station.resample('h', on='Return').trip.sum()\n",
    "\n",
    "  print('Writing aggregated dataframe to .csv...')\n",
    "  try:\n",
    "    name = station.replace('/', '-')\n",
    "    temp_station.to_csv('datasets/' + name + '_return_hourly_aggregate.csv', mode='x')\n",
    "  except Exception as e:\n",
    "    print(f'Failed to write {station} due to {e}')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Plotting the Distribution of Bike Trips by Year**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/tmp/ipykernel_354687/4263803594.py:1: DtypeWarning: Columns (3,5) have mixed types. Specify dtype option on import or set low_memory=False.\n",
      "  df = pd.read_csv('datasets/full_bike_data.csv', low_memory=True)\n",
      "/tmp/ipykernel_354687/4263803594.py:8: FutureWarning: \n",
      "\n",
      "Passing `palette` without assigning `hue` is deprecated and will be removed in v0.14.0. Assign the `x` variable to `hue` and set `legend=False` for the same effect.\n",
      "\n",
      "  sns.barplot(x=bike_trips_per_year['Year'], y=bike_trips_per_year['Number of Trips'], palette='viridis')\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 21376 characters]",
      "text/plain": [
       "<Figure size 1000x600 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df = pd.read_csv('datasets/full_bike_data.csv', low_memory=True)\n",
    "\n",
    "df['Departure'] = pd.to_datetime(df['Departure'])\n",
    "df['Year'] = df['Departure'].dt.year\n",
    "bike_trips_per_year = df.groupby('Year').size().reset_index(name='Number of Trips')\n",
    "\n",
    "plt.figure(figsize=(10, 6))\n",
    "sns.barplot(x=bike_trips_per_year['Year'], y=bike_trips_per_year['Number of Trips'], palette='viridis')\n",
    "\n",
    "plt.xlabel('Year')\n",
    "plt.ylabel('Number of Trips (in millions)')\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Model for Predicting Departure Count**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.08274263164029039\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/tmp/ipykernel_3569458/992788154.py:23: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`\n",
      "  print(res.forecast('2024-06-15 14:00:00')[-1])\n"
     ]
    }
   ],
   "source": [
    "station = 'Kamppi (M)'\n",
    "\n",
    "data = pd.read_csv('datasets/' + station + '_hourly_aggregate.csv')\n",
    "data['Departure'] = pd.to_datetime(data['Departure'], format='mixed')\n",
    "\n",
    "weather_df = pd.read_csv('datasets/weather_hourly_helsinki.csv', header=2)\n",
    "weather_df['time'] = pd.to_datetime(weather_df['time'], format='mixed')\n",
    "\n",
    "data = pd.merge(weather_df, data, how='inner', left_on='time', right_on='Departure')\n",
    "data = data.drop(['time'], axis=1)\n",
    "data.set_index(data['temperature_2m (°C)'], inplace=True)\n",
    "data.set_index(data['rain (mm)'], inplace=True)\n",
    "data.set_index(data['Departure'], inplace=True)\n",
    "\n",
    "data['temperature_2m (°C)'] = pd.to_numeric(data['temperature_2m (°C)'], errors='coerce')\n",
    "data['rain (mm)'] = pd.to_numeric(data['rain (mm)'], errors='coerce')\n",
    "data['trip'] = pd.to_numeric(data['trip'], errors='coerce')\n",
    "\n",
    "data = data.dropna(axis=1)\n",
    "\n",
    "mod = sm.tsa.statespace.SARIMAX(data['trip'], order=(1, 1, 1), seasonal_order=(0, 1, 0, 24), freq='h')\n",
    "res = mod.fit(disp=False)\n",
    "print(res.forecast('2024-06-15 14:00:00')[-1])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Model for Predicting Return Count**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/elliot/Projects/data-science-project/backend/env/lib/python3.12/site-packages/statsmodels/tsa/base/tsa_model.py:473: ValueWarning: No frequency information was provided, so inferred frequency h will be used.\n",
      "  self._init_dates(dates, freq)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2023-11-01 00:00:00    0.332839\n",
      "2023-11-01 01:00:00    0.108983\n",
      "2023-11-01 02:00:00    1.033872\n",
      "2023-11-01 03:00:00    0.008670\n",
      "2023-11-01 04:00:00    0.000214\n",
      "                         ...   \n",
      "2024-06-15 10:00:00    0.075210\n",
      "2024-06-15 11:00:00    1.075206\n",
      "2024-06-15 12:00:00    2.075204\n",
      "2024-06-15 13:00:00    0.075204\n",
      "2024-06-15 14:00:00    0.075204\n",
      "Freq: h, Name: predicted_mean, Length: 5463, dtype: float64\n"
     ]
    }
   ],
   "source": [
    "station = 'Kamppi (M)'\n",
    "\n",
    "data = pd.read_csv('datasets/' + station + '_return_hourly_aggregate.csv')\n",
    "data['Return'] = pd.to_datetime(data['Return'], format='mixed')\n",
    "\n",
    "weather_df = pd.read_csv('datasets/weather_hourly_helsinki.csv', header=2)\n",
    "weather_df['time'] = pd.to_datetime(weather_df['time'], format='mixed')\n",
    "\n",
    "data = pd.merge(weather_df, data, how='inner', left_on='time', right_on='Return')\n",
    "data = data.drop(['time'], axis=1)\n",
    "data.set_index(data['temperature_2m (°C)'], inplace=True)\n",
    "data.set_index(data['rain (mm)'], inplace=True)\n",
    "data.set_index(data['Return'], inplace=True)\n",
    "\n",
    "data['temperature_2m (°C)'] = pd.to_numeric(data['temperature_2m (°C)'], errors='coerce')\n",
    "data['rain (mm)'] = pd.to_numeric(data['rain (mm)'], errors='coerce')\n",
    "data['trip'] = pd.to_numeric(data['trip'], errors='coerce')\n",
    "\n",
    "data = data.dropna(axis=1)\n",
    "\n",
    "mod = sm.tsa.statespace.SARIMAX(data['trip'], order=(1, 1, 1), seasonal_order=(0, 1, 0, 24), freq='h')\n",
    "res = mod.fit(disp=False)\n",
    "print(res.forecast('2024-06-15 14:00:00'))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "env",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
