{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "5ec09a1980f583e",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "# Yahoo Finance Data DL\n",
    "\n",
    "* Download historical data for analysis (raw)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4e7c6353ee2365ed",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## Install deps"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "initial_id",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T12:57:50.171570Z",
     "start_time": "2024-03-09T12:57:46.685081Z"
    },
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: yfinance==0.2.37 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from yfinance[optional]==0.2.37) (0.2.37)\r\n",
      "Requirement already satisfied: pandas>=1.3.0 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from yfinance==0.2.37->yfinance[optional]==0.2.37) (2.2.1)\r\n",
      "Requirement already satisfied: numpy>=1.16.5 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from yfinance==0.2.37->yfinance[optional]==0.2.37) (1.26.4)\r\n",
      "Requirement already satisfied: requests>=2.31 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from yfinance==0.2.37->yfinance[optional]==0.2.37) (2.31.0)\r\n",
      "Requirement already satisfied: multitasking>=0.0.7 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from yfinance==0.2.37->yfinance[optional]==0.2.37) (0.0.11)\r\n",
      "Requirement already satisfied: lxml>=4.9.1 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from yfinance==0.2.37->yfinance[optional]==0.2.37) (5.1.0)\r\n",
      "Requirement already satisfied: appdirs>=1.4.4 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from yfinance==0.2.37->yfinance[optional]==0.2.37) (1.4.4)\r\n",
      "Requirement already satisfied: pytz>=2022.5 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from yfinance==0.2.37->yfinance[optional]==0.2.37) (2024.1)\r\n",
      "Requirement already satisfied: frozendict>=2.3.4 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from yfinance==0.2.37->yfinance[optional]==0.2.37) (2.4.0)\r\n",
      "Requirement already satisfied: peewee>=3.16.2 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from yfinance==0.2.37->yfinance[optional]==0.2.37) (3.17.1)\r\n",
      "Requirement already satisfied: beautifulsoup4>=4.11.1 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from yfinance==0.2.37->yfinance[optional]==0.2.37) (4.12.3)\r\n",
      "Requirement already satisfied: html5lib>=1.1 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from yfinance==0.2.37->yfinance[optional]==0.2.37) (1.1)\r\n",
      "\u001b[33mWARNING: yfinance 0.2.37 does not provide the extra 'optional'\u001b[0m\u001b[33m\r\n",
      "\u001b[0mRequirement already satisfied: soupsieve>1.2 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from beautifulsoup4>=4.11.1->yfinance==0.2.37->yfinance[optional]==0.2.37) (2.5)\r\n",
      "Requirement already satisfied: six>=1.9 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from html5lib>=1.1->yfinance==0.2.37->yfinance[optional]==0.2.37) (1.16.0)\r\n",
      "Requirement already satisfied: webencodings in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from html5lib>=1.1->yfinance==0.2.37->yfinance[optional]==0.2.37) (0.5.1)\r\n",
      "Requirement already satisfied: python-dateutil>=2.8.2 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from pandas>=1.3.0->yfinance==0.2.37->yfinance[optional]==0.2.37) (2.9.0)\r\n",
      "Requirement already satisfied: tzdata>=2022.7 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from pandas>=1.3.0->yfinance==0.2.37->yfinance[optional]==0.2.37) (2024.1)\r\n",
      "Requirement already satisfied: charset-normalizer<4,>=2 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from requests>=2.31->yfinance==0.2.37->yfinance[optional]==0.2.37) (3.3.2)\r\n",
      "Requirement already satisfied: idna<4,>=2.5 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from requests>=2.31->yfinance==0.2.37->yfinance[optional]==0.2.37) (3.6)\r\n",
      "Requirement already satisfied: urllib3<3,>=1.21.1 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from requests>=2.31->yfinance==0.2.37->yfinance[optional]==0.2.37) (2.2.1)\r\n",
      "Requirement already satisfied: certifi>=2017.4.17 in /home/marius/miniconda3/envs/lang_chain/lib/python3.11/site-packages (from requests>=2.31->yfinance==0.2.37->yfinance[optional]==0.2.37) (2024.2.2)\r\n",
      "Note: you may need to restart the kernel to use updated packages.\n"
     ]
    }
   ],
   "source": [
    "%pip install \"yfinance[optional]\"==\"0.2.37\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "48b1ebb620c74042",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## DL\n",
    "\n",
    "* HG=F - Copper"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "7d72d656bb3bef8d",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T12:57:52.729521Z",
     "start_time": "2024-03-09T12:57:52.705820Z"
    },
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import yfinance as yf\n",
    "\n",
    "hg_f = yf.Ticker(\"HG=F\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "cd6f3f72c56be9a1",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T12:57:54.067233Z",
     "start_time": "2024-03-09T12:57:53.991242Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'maxAge': 86400,\n",
       " 'priceHint': 4,\n",
       " 'previousClose': 3.926,\n",
       " 'open': 3.9255,\n",
       " 'dayLow': 3.8815,\n",
       " 'dayHigh': 3.9465,\n",
       " 'regularMarketPreviousClose': 3.926,\n",
       " 'regularMarketOpen': 3.9255,\n",
       " 'regularMarketDayLow': 3.8815,\n",
       " 'regularMarketDayHigh': 3.9465,\n",
       " 'volume': 80624,\n",
       " 'regularMarketVolume': 80624,\n",
       " 'averageVolume': 1088,\n",
       " 'averageVolume10days': 4041,\n",
       " 'averageDailyVolume10Day': 4041,\n",
       " 'bid': 3.8905,\n",
       " 'ask': 3.8915,\n",
       " 'bidSize': 800,\n",
       " 'askSize': 1200,\n",
       " 'expireDate': 1716940800,\n",
       " 'openInterest': 126184,\n",
       " 'fiftyTwoWeekLow': 3.53,\n",
       " 'fiftyTwoWeekHigh': 4.1895,\n",
       " 'fiftyDayAverage': 3.81898,\n",
       " 'twoHundredDayAverage': 3.7641976,\n",
       " 'currency': 'USD',\n",
       " 'exchange': 'CMX',\n",
       " 'quoteType': 'FUTURE',\n",
       " 'symbol': 'HGK24.CMX',\n",
       " 'underlyingSymbol': 'HG=F',\n",
       " 'shortName': 'Copper May 24',\n",
       " 'firstTradeDateEpochUtc': 967608000,\n",
       " 'timeZoneFullName': 'America/New_York',\n",
       " 'timeZoneShortName': 'EST',\n",
       " 'uuid': '02846b86-92eb-33ab-a801-f9b43107619f',\n",
       " 'gmtOffSetMilliseconds': -18000000,\n",
       " 'trailingPegRatio': None}"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# get all stock info\n",
    "hg_f.info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "89fddac643750762",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T13:09:14.698670Z",
     "start_time": "2024-03-09T13:09:14.621937Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>Dividends</th>\n",
       "      <th>Stock Splits</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2023-03-09 00:00:00-05:00</th>\n",
       "      <td>4.0465</td>\n",
       "      <td>4.0565</td>\n",
       "      <td>4.0300</td>\n",
       "      <td>4.0545</td>\n",
       "      <td>584</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-03-10 00:00:00-05:00</th>\n",
       "      <td>4.0120</td>\n",
       "      <td>4.0675</td>\n",
       "      <td>3.9900</td>\n",
       "      <td>4.0455</td>\n",
       "      <td>591</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-03-13 00:00:00-04:00</th>\n",
       "      <td>4.0230</td>\n",
       "      <td>4.0800</td>\n",
       "      <td>3.9460</td>\n",
       "      <td>4.0695</td>\n",
       "      <td>842</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-03-14 00:00:00-04:00</th>\n",
       "      <td>4.0395</td>\n",
       "      <td>4.0620</td>\n",
       "      <td>4.0010</td>\n",
       "      <td>4.0105</td>\n",
       "      <td>923</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2023-03-15 00:00:00-04:00</th>\n",
       "      <td>4.0210</td>\n",
       "      <td>4.0210</td>\n",
       "      <td>3.8565</td>\n",
       "      <td>3.8565</td>\n",
       "      <td>875</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-03-04 00:00:00-05:00</th>\n",
       "      <td>3.8450</td>\n",
       "      <td>3.8815</td>\n",
       "      <td>3.8435</td>\n",
       "      <td>3.8520</td>\n",
       "      <td>1136</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-03-05 00:00:00-05:00</th>\n",
       "      <td>3.8465</td>\n",
       "      <td>3.8630</td>\n",
       "      <td>3.8380</td>\n",
       "      <td>3.8440</td>\n",
       "      <td>929</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-03-06 00:00:00-05:00</th>\n",
       "      <td>3.8400</td>\n",
       "      <td>3.8915</td>\n",
       "      <td>3.8375</td>\n",
       "      <td>3.8705</td>\n",
       "      <td>987</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-03-07 00:00:00-05:00</th>\n",
       "      <td>3.8740</td>\n",
       "      <td>3.9310</td>\n",
       "      <td>3.8740</td>\n",
       "      <td>3.9195</td>\n",
       "      <td>1243</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-03-08 00:00:00-05:00</th>\n",
       "      <td>3.9175</td>\n",
       "      <td>3.9320</td>\n",
       "      <td>3.8780</td>\n",
       "      <td>3.8850</td>\n",
       "      <td>1243</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>252 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                             Open    High     Low   Close Volume  Dividends  \\\n",
       "Date                                                                          \n",
       "2023-03-09 00:00:00-05:00  4.0465  4.0565  4.0300  4.0545    584        NaN   \n",
       "2023-03-10 00:00:00-05:00  4.0120  4.0675  3.9900  4.0455    591        NaN   \n",
       "2023-03-13 00:00:00-04:00  4.0230  4.0800  3.9460  4.0695    842        NaN   \n",
       "2023-03-14 00:00:00-04:00  4.0395  4.0620  4.0010  4.0105    923        NaN   \n",
       "2023-03-15 00:00:00-04:00  4.0210  4.0210  3.8565  3.8565    875        NaN   \n",
       "...                           ...     ...     ...     ...    ...        ...   \n",
       "2024-03-04 00:00:00-05:00  3.8450  3.8815  3.8435  3.8520   1136        NaN   \n",
       "2024-03-05 00:00:00-05:00  3.8465  3.8630  3.8380  3.8440    929        NaN   \n",
       "2024-03-06 00:00:00-05:00  3.8400  3.8915  3.8375  3.8705    987        NaN   \n",
       "2024-03-07 00:00:00-05:00  3.8740  3.9310  3.8740  3.9195   1243        NaN   \n",
       "2024-03-08 00:00:00-05:00  3.9175  3.9320  3.8780  3.8850   1243        NaN   \n",
       "\n",
       "                           Stock Splits  \n",
       "Date                                     \n",
       "2023-03-09 00:00:00-05:00           NaN  \n",
       "2023-03-10 00:00:00-05:00           NaN  \n",
       "2023-03-13 00:00:00-04:00           NaN  \n",
       "2023-03-14 00:00:00-04:00           NaN  \n",
       "2023-03-15 00:00:00-04:00           NaN  \n",
       "...                                 ...  \n",
       "2024-03-04 00:00:00-05:00           NaN  \n",
       "2024-03-05 00:00:00-05:00           NaN  \n",
       "2024-03-06 00:00:00-05:00           NaN  \n",
       "2024-03-07 00:00:00-05:00           NaN  \n",
       "2024-03-08 00:00:00-05:00           NaN  \n",
       "\n",
       "[252 rows x 7 columns]"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "# get historical market data\n",
    "hist = hg_f.history(period=\"1y\")\n",
    "\n",
    "# Replace 0 values with NaN in specific columns\n",
    "hist.replace({'Volume': {0: pd.NA}, 'Open': {0: pd.NA}}, inplace=True)\n",
    "hist.replace(0, np.nan, inplace=True)  # Replace 0 with NaN\n",
    "\n",
    "# Drop rows with NaN values in these specific columns\n",
    "hist.dropna(subset=['Volume', 'Open'], inplace=True)\n",
    "\n",
    "hist\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "1593cdb6a096c786",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T13:09:57.377149Z",
     "start_time": "2024-03-09T13:09:57.083539Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 22392 characters]",
      "text/plain": [
       "<Figure size 1200x500 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "# Assuming 'data' is your DataFrame\n",
    "plt.figure(figsize=(12, 5))\n",
    "\n",
    "\n",
    "\n",
    "# Plotting Open\n",
    "plt.subplot(1, 2, 2)\n",
    "hist['Open'].hist(bins=20)\n",
    "plt.title('Open Price Histogram')\n",
    "plt.xlabel('Open Price')\n",
    "plt.ylabel('Frequency')\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "b4055c5600389958",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T13:12:19.024137Z",
     "start_time": "2024-03-09T13:12:18.618590Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 77236 characters]",
      "text/plain": [
       "<Figure size 1000x600 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "\n",
    "\n",
    "# Plotting the 'Open' price as a line plot\n",
    "plt.figure(figsize=(10, 6))\n",
    "hist['Open'].plot(kind='line', title='Open Price Over Time', xlabel='Date', ylabel='Open Price')\n",
    "plt.grid(True)\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "d52316a08ff9b66c",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T13:14:26.336620Z",
     "start_time": "2024-03-09T13:14:25.884041Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 83344 characters]",
      "text/plain": [
       "<Figure size 1000x600 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# Assuming 'hist' is your DataFrame with 'Date' set as the index and non-zero 'Open' values\n",
    "\n",
    "# Calculate daily change in 'Open' prices\n",
    "hist['OpenChange'] = hist['Open'].diff()\n",
    "\n",
    "# Find points where the change in 'Open' price shifts direction\n",
    "# This is a simple way to spot potential trend changes\n",
    "trend_changes = hist['OpenChange'] * hist['OpenChange'].shift(-1) < 0\n",
    "\n",
    "# Plotting the 'Open' price as a line plot\n",
    "plt.figure(figsize=(10, 6))\n",
    "hist['Open'].plot(kind='line', title='Open Price Over Time', xlabel='Date', ylabel='Open Price')\n",
    "plt.grid(True)\n",
    "\n",
    "# Marking trend changes\n",
    "for date, change in trend_changes.items():\n",
    "    if change:\n",
    "        plt.plot(date, hist.loc[date, 'Open'], 'ro')  # Mark with red circle\n",
    "\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "2b5d8506b2dfa72d",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:47:07.717890Z",
     "start_time": "2024-03-09T07:47:07.673377Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'currency': 'USD',\n",
       " 'symbol': 'HG=F',\n",
       " 'exchangeName': 'CMX',\n",
       " 'instrumentType': 'FUTURE',\n",
       " 'firstTradeDate': 967608000,\n",
       " 'regularMarketTime': 1709935198,\n",
       " 'hasPrePostMarketData': False,\n",
       " 'gmtoffset': -18000,\n",
       " 'timezone': 'EST',\n",
       " 'exchangeTimezoneName': 'America/New_York',\n",
       " 'regularMarketPrice': 3.891,\n",
       " 'chartPreviousClose': 4.042,\n",
       " 'priceHint': 4,\n",
       " 'currentTradingPeriod': {'pre': {'timezone': 'EST',\n",
       "   'start': 1709874000,\n",
       "   'end': 1709874000,\n",
       "   'gmtoffset': -18000},\n",
       "  'regular': {'timezone': 'EST',\n",
       "   'start': 1709874000,\n",
       "   'end': 1709960340,\n",
       "   'gmtoffset': -18000},\n",
       "  'post': {'timezone': 'EST',\n",
       "   'start': 1709960340,\n",
       "   'end': 1709960340,\n",
       "   'gmtoffset': -18000}},\n",
       " 'dataGranularity': '1d',\n",
       " 'range': '1y',\n",
       " 'validRanges': ['1d',\n",
       "  '5d',\n",
       "  '1mo',\n",
       "  '3mo',\n",
       "  '6mo',\n",
       "  '1y',\n",
       "  '2y',\n",
       "  '5y',\n",
       "  '10y',\n",
       "  'ytd',\n",
       "  'max']}"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# show meta information about the history (requires history() to be called first)\n",
    "hg_f.history_metadata"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "1b4d37d54e81a9da",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:40:48.287480Z",
     "start_time": "2024-03-09T07:40:48.264700Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Series([], dtype: object)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# show actions (dividends, splits, capital gains)\n",
    "hg_f.actions\n",
    "hg_f.dividends\n",
    "hg_f.splits\n",
    "hg_f.capital_gains  # only for mutual funds & etfs\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "de2e437452c43687",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:41:18.436284Z",
     "start_time": "2024-03-09T07:41:18.411883Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "yfinance.Ticker object <HG=F>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# show share count\n",
    "hg_f.get_shares_full(start=\"2022-01-01\", end=None)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "df7d9490335bf41a",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:42:00.119462Z",
     "start_time": "2024-03-09T07:42:00.089495Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: []\n",
       "Index: []"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hg_f.income_stmt\n",
    "hg_f.quarterly_income_stmt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "2909062e99a951b6",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:42:15.633015Z",
     "start_time": "2024-03-09T07:42:15.630512Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: []\n",
       "Index: []"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# - balance sheet\n",
    "hg_f.balance_sheet\n",
    "hg_f.quarterly_balance_sheet"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "b96ce990167d3a45",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:42:26.935833Z",
     "start_time": "2024-03-09T07:42:26.895263Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: []\n",
       "Index: []"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# - cash flow statement\n",
    "hg_f.cashflow\n",
    "hg_f.quarterly_cashflow\n",
    "# see `Ticker.get_income_stmt()` for more options"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "8c28e69e8dbba15e",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:42:38.982803Z",
     "start_time": "2024-03-09T07:42:38.003279Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "404 Client Error: Not Found for url: https://query2.finance.yahoo.com/v10/finance/quoteSummary/?modules=institutionOwnership%2CfundOwnership%2CmajorDirectHolders%2CmajorHoldersBreakdown%2CinsiderTransactions%2CinsiderHolders%2CnetSharePurchaseActivity&corsDomain=finance.yahoo.com&symbol=HG%3DF&formatted=false&crumb=kY9MYXZrrjV\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: []\n",
       "Index: []"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "# show holders\n",
    "hg_f.major_holders\n",
    "hg_f.institutional_holders\n",
    "hg_f.mutualfund_holders\n",
    "hg_f.insider_transactions\n",
    "hg_f.insider_purchases\n",
    "hg_f.insider_roster_holders\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "f8b90eeae3dbad17",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:42:58.365869Z",
     "start_time": "2024-03-09T07:42:57.287372Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "404 Client Error: Not Found for url: https://query2.finance.yahoo.com/v10/finance/quoteSummary/HG=F?modules=recommendationTrend&corsDomain=finance.yahoo.com&formatted=false&symbol=HG%3DF&crumb=kY9MYXZrrjV\n",
      "404 Client Error: Not Found for url: https://query2.finance.yahoo.com/v10/finance/quoteSummary/HG=F?modules=upgradeDowngradeHistory&corsDomain=finance.yahoo.com&formatted=false&symbol=HG%3DF&crumb=kY9MYXZrrjV\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: []\n",
       "Index: []"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# show recommendations\n",
    "hg_f.recommendations\n",
    "hg_f.recommendations_summary\n",
    "hg_f.upgrades_downgrades\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "afa3e15b051554a",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:43:16.861853Z",
     "start_time": "2024-03-09T07:43:16.247498Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "HG=F: No earnings dates found, symbol may be delisted\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# Show future and historic earnings dates, returns at most next 4 quarters and last 8 quarters by default. \n",
    "# Note: If more are needed use msft.get_earnings_dates(limit=XX) with increased limit argument.\n",
    "hg_f.earnings_dates"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "506d811b32bc7e9c",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:43:27.416624Z",
     "start_time": "2024-03-09T07:43:27.378458Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'-'"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "# show ISIN code - *experimental*\n",
    "# ISIN = International Securities Identification Number\n",
    "hg_f.isin"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "842e7bd47877f711",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:43:39.146196Z",
     "start_time": "2024-03-09T07:43:39.069686Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "()"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "# show options expirations\n",
    "hg_f.options\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "656b5ec6618e155f",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:43:47.992734Z",
     "start_time": "2024-03-09T07:43:47.958054Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'uuid': 'a081de49-3834-35d7-9b1a-49ae61a24622',\n",
       "  'title': 'EMERGING MARKETS-Latam stocks advance, weak copper prices drag currencies of Chile, Peru',\n",
       "  'publisher': 'Reuters',\n",
       "  'link': 'https://finance.yahoo.com/news/emerging-markets-latam-stocks-advance-153434824.html',\n",
       "  'providerPublishTime': 1706283274,\n",
       "  'type': 'STORY',\n",
       "  'relatedTickers': ['HG=F', '^BVSP', '^MXX']},\n",
       " {'uuid': '08c6cfc7-1146-374c-bf8f-8f02328cc4b1',\n",
       "  'title': 'CANADA STOCKS-TSX futures edge up on higher gold prices; US data in focus',\n",
       "  'publisher': 'Reuters',\n",
       "  'link': 'https://finance.yahoo.com/news/canada-stocks-tsx-futures-edge-123846632.html',\n",
       "  'providerPublishTime': 1706272726,\n",
       "  'type': 'STORY',\n",
       "  'relatedTickers': ['GC=F', 'ZG=F', 'HG=F', '^GSPC']},\n",
       " {'uuid': '1666725e-a880-3220-be81-4b39be02d706',\n",
       "  'title': 'These Are the 4 Best Silver Coin Types To Buy in Order To Turn a Profit',\n",
       "  'publisher': 'GOBankingRates',\n",
       "  'link': 'https://finance.yahoo.com/news/4-best-silver-coin-types-123010528.html',\n",
       "  'providerPublishTime': 1706272210,\n",
       "  'type': 'STORY',\n",
       "  'thumbnail': {'resolutions': [{'url': 'https://s.yimg.com/uu/api/res/1.2/BhiemWjsPOiPzWVgmzWacQ--~B/aD0xMDgwO3c9MTkyMDthcHBpZD15dGFjaHlvbg--/https://media.zenfs.com/en/gobankingrates_644/397831e32274b07c29579b8e42a54267',\n",
       "     'width': 1920,\n",
       "     'height': 1080,\n",
       "     'tag': 'original'},\n",
       "    {'url': 'https://s.yimg.com/uu/api/res/1.2/__z5WbG1O.bg53xqLE74Dg--~B/Zmk9ZmlsbDtoPTE0MDtweW9mZj0wO3c9MTQwO2FwcGlkPXl0YWNoeW9u/https://media.zenfs.com/en/gobankingrates_644/397831e32274b07c29579b8e42a54267',\n",
       "     'width': 140,\n",
       "     'height': 140,\n",
       "     'tag': '140x140'}]},\n",
       "  'relatedTickers': ['GC=F', 'ZG=F', 'HG=F', 'SI=F', 'ZI=F']},\n",
       " {'uuid': '0edc4734-fb05-3bb1-a95b-9e11c776fdc5',\n",
       "  'title': 'Gold prices struggle before inflation, Fed cues; copper set for strong week',\n",
       "  'publisher': 'Investing.com',\n",
       "  'link': 'https://finance.yahoo.com/news/gold-prices-struggle-inflation-fed-001606596.html',\n",
       "  'providerPublishTime': 1706228166,\n",
       "  'type': 'STORY',\n",
       "  'relatedTickers': ['HG=F', 'GC=F', 'ZG=F']},\n",
       " {'uuid': '7b91db52-a3f1-335d-9176-6d61187cf0a7',\n",
       "  'title': 'Basic Materials Roundup: Market Talk',\n",
       "  'publisher': 'The Wall Street Journal',\n",
       "  'link': 'https://finance.yahoo.com/m/7b91db52-a3f1-335d-9176-6d61187cf0a7/basic-materials-roundup%3A.html',\n",
       "  'providerPublishTime': 1706219880,\n",
       "  'type': 'STORY',\n",
       "  'thumbnail': {'resolutions': [{'url': 'https://s.yimg.com/uu/api/res/1.2/hus7PFWagBBSuGWsuAHBxA--~B/aD02NDA7dz0xMjgwO2FwcGlkPXl0YWNoeW9u/https://media.zenfs.com/en/wsj.com/7e9c00d68c1ab82df50577310bb19679',\n",
       "     'width': 1280,\n",
       "     'height': 640,\n",
       "     'tag': 'original'},\n",
       "    {'url': 'https://s.yimg.com/uu/api/res/1.2/2AS8Z8b8P15BKyqk61NEWQ--~B/Zmk9ZmlsbDtoPTE0MDtweW9mZj0wO3c9MTQwO2FwcGlkPXl0YWNoeW9u/https://media.zenfs.com/en/wsj.com/7e9c00d68c1ab82df50577310bb19679',\n",
       "     'width': 140,\n",
       "     'height': 140,\n",
       "     'tag': '140x140'}]},\n",
       "  'relatedTickers': ['GVDBF', 'GVDNY', 'GC=F', 'ZG=F', 'HG=F']},\n",
       " {'uuid': '2ce9d404-879c-3b5c-85c2-652c92639df1',\n",
       "  'title': 'Closing prices for crude oil, gold and other commodities',\n",
       "  'publisher': 'Associated Press Finance',\n",
       "  'link': 'https://finance.yahoo.com/news/closing-prices-crude-oil-gold-201521282.html',\n",
       "  'providerPublishTime': 1706213721,\n",
       "  'type': 'STORY',\n",
       "  'relatedTickers': ['CL=F',\n",
       "   'SI=F',\n",
       "   'ZI=F',\n",
       "   'NG=F',\n",
       "   'GC=F',\n",
       "   'ZG=F',\n",
       "   'HG=F',\n",
       "   'HO=F']},\n",
       " {'uuid': 'e0748b77-83b7-34c3-b83e-f55508291594',\n",
       "  'title': 'Crypto for Advisors: Unlocking Crypto Custody',\n",
       "  'publisher': 'CoinDesk',\n",
       "  'link': 'https://finance.yahoo.com/m/e0748b77-83b7-34c3-b83e-f55508291594/crypto-for-advisors%3A.html',\n",
       "  'providerPublishTime': 1706199734,\n",
       "  'type': 'STORY',\n",
       "  'thumbnail': {'resolutions': [{'url': 'https://s.yimg.com/uu/api/res/1.2/YvjxRlrTdjUCMJlc1MT4tg--~B/aD0zMDAwO3c9NDUwMDthcHBpZD15dGFjaHlvbg--/https://media.zenfs.com/en/coindesk_75/c7a00a6fe2bc93bfbbac3e92d2fac0e6',\n",
       "     'width': 4500,\n",
       "     'height': 3000,\n",
       "     'tag': 'original'},\n",
       "    {'url': 'https://s.yimg.com/uu/api/res/1.2/q.NOd5AdTb2Y1wpOwX9L.w--~B/Zmk9ZmlsbDtoPTE0MDtweW9mZj0wO3c9MTQwO2FwcGlkPXl0YWNoeW9u/https://media.zenfs.com/en/coindesk_75/c7a00a6fe2bc93bfbbac3e92d2fac0e6',\n",
       "     'width': 140,\n",
       "     'height': 140,\n",
       "     'tag': '140x140'}]},\n",
       "  'relatedTickers': ['HG=F']},\n",
       " {'uuid': '922264e0-c1d2-3af4-9d38-c318b8a7b523',\n",
       "  'title': \"Blinken hails progress in construction of Angola's Lobito rail corridor\",\n",
       "  'publisher': 'Reuters',\n",
       "  'link': 'https://finance.yahoo.com/news/blinken-hails-progress-construction-angolas-155740812.html',\n",
       "  'providerPublishTime': 1706198260,\n",
       "  'type': 'STORY',\n",
       "  'relatedTickers': ['HG=F']}]"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# show news\n",
    "hg_f.news"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "ffd1a25566eed606",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-03-09T07:44:10.426336Z",
     "start_time": "2024-03-09T07:44:10.346101Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "Expiration `2024-06-21` cannot be found. Available expirations are: []",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[29], line 2\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[38;5;66;03m# get option chain for specific expiration\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m opt \u001b[38;5;241m=\u001b[39m \u001b[43mhg_f\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moption_chain\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m2024-06-21\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m      3\u001b[0m \u001b[38;5;66;03m# data available via: opt.calls, opt.puts\u001b[39;00m\n",
      "File \u001b[0;32m~/miniconda3/envs/lang_chain/lib/python3.11/site-packages/yfinance/ticker.py:91\u001b[0m, in \u001b[0;36mTicker.option_chain\u001b[0;34m(self, date, tz)\u001b[0m\n\u001b[1;32m     89\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_download_options()\n\u001b[1;32m     90\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m date \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_expirations:\n\u001b[0;32m---> 91\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m     92\u001b[0m         \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mExpiration `\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mdate\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m` cannot be found. \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m     93\u001b[0m         \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mAvailable expirations are: [\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m, \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mjoin(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_expirations)\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m]\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m     94\u001b[0m date \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_expirations[date]\n\u001b[1;32m     95\u001b[0m options \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_download_options(date)\n",
      "\u001b[0;31mValueError\u001b[0m: Expiration `2024-06-21` cannot be found. Available expirations are: []"
     ]
    }
   ],
   "source": [
    "# get option chain for specific expiration\n",
    "opt = hg_f.option_chain('2024-06-21')\n",
    "# data available via: opt.calls, opt.puts\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6b61bc4f626b4dc",
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
