{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Percentage of occurence example\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import pandas as pd\nimport toto\nimport matplotlib.pyplot as plt\nfrom toto.inputs.txt import TXTfile\nimport os\n# read the file\nhindcast='https://raw.githubusercontent.com/calypso-science/Toto/master/_tests/txt_file/tahuna_hindcast.txt'\nos.system('wget %s ' % hindcast)\n\nhd=TXTfile(['tahuna_hindcast.txt'],colNamesLine=1,skiprows=1,unitNamesLine=0,time_col_name={'Year':'year','Month':'month','Day':'day','Hour':'hour','Min':'Minute'})\nhd.reads()\nhd.read_time()\nhd=hd._toDataFrame()\n\n# # Processing\nhd[0].StatPlots.percentage_of_occurence(mag='hs',drr='dpm',args={\n                'magnitude interval (optional)':[],\n                'X label':'Significant wave height in m',\n                'time blocking':'Annual',\n                'direction binning':'centered',\n                'direction interval': 90.,\n                'display':'On'})"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "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.8.10"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}