{
 "nbformat": 4,
 "nbformat_minor": 2,
 "metadata": {
  "language_info": {
   "name": "python",
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "version": "3.7.3-final"
  },
  "orig_nbformat": 2,
  "file_extension": ".py",
  "mimetype": "text/x-python",
  "name": "python",
  "npconvert_exporter": "python",
  "pygments_lexer": "ipython3",
  "version": 3,
  "kernelspec": {
   "name": "gw",
   "display_name": "gw"
  }
 },
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import ausweather"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": "station #: 23090 name: ADELAIDE (KENT TOWN) title: 23090 ADELAIDE (KENT TOWN) (fetched from SILO on 2020-04-20 20:33:08.208200)\n"
    }
   ],
   "source": [
    "data = ausweather.fetch_bom_station_from_silo(23090, 'kinverarity@hotmail.com')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "dict_keys(['silo_returned', 'station_no', 'station_name', 'title', 'df', 'annual', 'srn'])"
     },
     "metadata": {},
     "execution_count": 4
    }
   ],
   "source": [
    "data.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "Date\n1950    426.9\n1951    677.9\n1952    584.9\n1953    601.0\n1954    439.6\n        ...  \n2016    820.8\n2017    536.2\n2018    429.8\n2019    376.3\n2020    101.6\nName: Rain, Length: 71, dtype: float64"
     },
     "metadata": {},
     "execution_count": 7
    }
   ],
   "source": [
    "df = data[\"df\"]\n",
    "df.groupby(df.Date.dt.year).Rain.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ]
}