Skip to content

Commit 45ca547

Browse files
committed
pandas cookbook Chapter 0 - Quick Tour
1 parent 85ef178 commit 45ca547

File tree

2 files changed

+121
-7
lines changed

2 files changed

+121
-7
lines changed

Quick tour.ipynb

Lines changed: 121 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,40 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# My quick tour 6/11/2015"
8+
]
9+
},
310
{
411
"cell_type": "code",
5-
"execution_count": 1,
12+
"execution_count": 4,
613
"metadata": {
7-
"collapsed": true
14+
"collapsed": false
815
},
9-
"outputs": [],
16+
"outputs": [
17+
{
18+
"name": "stdout",
19+
"output_type": "stream",
20+
"text": [
21+
"Populating the interactive namespace from numpy and matplotlib\n",
22+
"Hello world\n"
23+
]
24+
}
25+
],
26+
"source": [
27+
"import pandas as pd\n",
28+
"%pylab inline\n",
29+
"\n",
30+
"print \"Hello world\""
31+
]
32+
},
33+
{
34+
"cell_type": "markdown",
35+
"metadata": {},
1036
"source": [
11-
"import pandas as pd"
37+
"##Autocompletion"
1238
]
1339
},
1440
{
@@ -27,20 +53,108 @@
2753
}
2854
],
2955
"source": [
30-
"%pylab inline"
56+
"pd.read_csv("
3157
]
3258
},
3359
{
3460
"cell_type": "markdown",
3561
"metadata": {},
3662
"source": [
37-
"#My quick tour"
63+
"![screen shot](autocompletion.png )"
3864
]
3965
},
4066
{
4167
"cell_type": "markdown",
4268
"metadata": {},
43-
"source": []
69+
"source": [
70+
"## Simple code"
71+
]
72+
},
73+
{
74+
"cell_type": "code",
75+
"execution_count": 8,
76+
"metadata": {
77+
"collapsed": false
78+
},
79+
"outputs": [
80+
{
81+
"name": "stdout",
82+
"output_type": "stream",
83+
"text": [
84+
"0 1 2 3 4 5 6 7 8 9\n"
85+
]
86+
}
87+
],
88+
"source": [
89+
"def print_10_nums():\n",
90+
" for i in range(10):\n",
91+
" print i,\n",
92+
"print_10_nums()"
93+
]
94+
},
95+
{
96+
"cell_type": "code",
97+
"execution_count": 10,
98+
"metadata": {
99+
"collapsed": false
100+
},
101+
"outputs": [
102+
{
103+
"name": "stdout",
104+
"output_type": "stream",
105+
"text": [
106+
"Wall time: 17 ms\n",
107+
"Wall time: 13 ms\n"
108+
]
109+
},
110+
{
111+
"data": {
112+
"text/plain": [
113+
"4999950000L"
114+
]
115+
},
116+
"execution_count": 10,
117+
"metadata": {},
118+
"output_type": "execute_result"
119+
}
120+
],
121+
"source": [
122+
"# %time to time the run\n",
123+
"%time sum([x for x in range(100000)])\n",
124+
"%time sum(x for x in range(100000))"
125+
]
126+
},
127+
{
128+
"cell_type": "code",
129+
"execution_count": 12,
130+
"metadata": {
131+
"collapsed": false
132+
},
133+
"outputs": [
134+
{
135+
"name": "stdout",
136+
"output_type": "stream",
137+
"text": [
138+
" "
139+
]
140+
}
141+
],
142+
"source": [
143+
"# profiling\n",
144+
"%prun sum(x for x in range(100000))"
145+
]
146+
},
147+
{
148+
"cell_type": "code",
149+
"execution_count": 11,
150+
"metadata": {
151+
"collapsed": true
152+
},
153+
"outputs": [],
154+
"source": [
155+
"# call a reference sheet\n",
156+
"%quickref"
157+
]
44158
}
45159
],
46160
"metadata": {

autocompletion.png

12.8 KB
Loading

0 commit comments

Comments
 (0)