Skip to content

Instantly share code, notes, and snippets.

@jtyberg
Last active November 10, 2015 20:27
Show Gist options
  • Save jtyberg/7c5c6ea7b541a821c298 to your computer and use it in GitHub Desktop.
Save jtyberg/7c5c6ea7b541a821c298 to your computer and use it in GitHub Desktop.
pandas_yahoo.ipynb
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div>\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>Adj Close</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",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>2015-01-02</th>\n",
" <td>111.389999</td>\n",
" <td>111.440002</td>\n",
" <td>107.349998</td>\n",
" <td>109.330002</td>\n",
" <td>53204600</td>\n",
" <td>107.498407</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015-01-05</th>\n",
" <td>108.290001</td>\n",
" <td>108.650002</td>\n",
" <td>105.410004</td>\n",
" <td>106.250000</td>\n",
" <td>64285500</td>\n",
" <td>104.470005</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015-01-06</th>\n",
" <td>106.540001</td>\n",
" <td>107.430000</td>\n",
" <td>104.629997</td>\n",
" <td>106.260002</td>\n",
" <td>65797100</td>\n",
" <td>104.479839</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015-01-07</th>\n",
" <td>107.199997</td>\n",
" <td>108.199997</td>\n",
" <td>106.699997</td>\n",
" <td>107.750000</td>\n",
" <td>40105900</td>\n",
" <td>105.944875</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015-01-08</th>\n",
" <td>109.230003</td>\n",
" <td>112.150002</td>\n",
" <td>108.699997</td>\n",
" <td>111.889999</td>\n",
" <td>59364500</td>\n",
" <td>110.015518</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Open High Low Close Volume \\\n",
"Date \n",
"2015-01-02 111.389999 111.440002 107.349998 109.330002 53204600 \n",
"2015-01-05 108.290001 108.650002 105.410004 106.250000 64285500 \n",
"2015-01-06 106.540001 107.430000 104.629997 106.260002 65797100 \n",
"2015-01-07 107.199997 108.199997 106.699997 107.750000 40105900 \n",
"2015-01-08 109.230003 112.150002 108.699997 111.889999 59364500 \n",
"\n",
" Adj Close \n",
"Date \n",
"2015-01-02 107.498407 \n",
"2015-01-05 104.470005 \n",
"2015-01-06 104.479839 \n",
"2015-01-07 105.944875 \n",
"2015-01-08 110.015518 "
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import datetime\n",
"import pandas\n",
"import pandas.io.data\n",
"\n",
"quotes = pandas.io.data.get_data_yahoo(\n",
" 'AAPL', \n",
" start=datetime.datetime(2015, 1, 1), \n",
" end=datetime.date.today()\n",
")\n",
"quotes.head()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"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.4.3"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment