{
"metadata": {
"name": "",
- "signature": "sha256:a0281c893b46c2a49f8ca60a55050ba07e01c477d80741db9e38b50971f0ed34"
+ "signature": "sha256:79decad1a699da8d950a948a249c8270194d5a7efe1d66f65f37c997a74f5325"
},
"nbformat": 3,
"nbformat_minor": 0,
"language": "python",
"metadata": {},
"outputs": [],
- "prompt_number": 17
+ "prompt_number": 3
},
{
"cell_type": "markdown",
{
"metadata": {},
"output_type": "pyout",
- "prompt_number": 18,
+ "prompt_number": 4,
"text": [
"99156"
]
}
],
- "prompt_number": 18
+ "prompt_number": 4
},
{
"cell_type": "markdown",
"language": "python",
"metadata": {},
"outputs": [],
- "prompt_number": 19
+ "prompt_number": 5
},
{
"cell_type": "markdown",
"language": "python",
"metadata": {},
"outputs": [],
- "prompt_number": 20
+ "prompt_number": 6
},
{
"cell_type": "markdown",
]
}
],
- "prompt_number": 21
+ "prompt_number": 7
},
{
"cell_type": "code",
"language": "python",
"metadata": {},
"outputs": [],
- "prompt_number": 22
+ "prompt_number": 8
},
{
"cell_type": "markdown",
"language": "python",
"metadata": {},
"outputs": [],
- "prompt_number": 23
+ "prompt_number": 9
},
{
"cell_type": "markdown",
"language": "python",
"metadata": {},
"outputs": [],
- "prompt_number": 24
+ "prompt_number": 10
},
{
"cell_type": "markdown",
"language": "python",
"metadata": {},
"outputs": [],
- "prompt_number": 25
+ "prompt_number": 11
},
{
"cell_type": "markdown",
"\n",
"We can also look at performance: which is the fastest?\n",
"\n",
- "Use the IPython timing cell-magic to find out. We'll also use an `assert`ion to check that all the approaches give the same answer."
+ "Use the IPython timing cell-magic to find out. We'll also use an `assert`ion to check that all the approaches give the same answer.\n",
+ "\n",
+ "You'll have to run the notebook to find the answer. Which do you think would be these fastest, or the slowest?"
]
},
{
{
"metadata": {},
"output_type": "pyout",
- "prompt_number": 38,
+ "prompt_number": 12,
"text": [
"62856"
]
}
],
- "prompt_number": 38
+ "prompt_number": 12
},
{
"cell_type": "code",
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "10 loops, best of 3: 70.2 ms per loop\n"
- ]
- }
- ],
- "prompt_number": 48
+ "outputs": []
},
{
"cell_type": "code",
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "10 loops, best of 3: 59.4 ms per loop\n"
- ]
- }
- ],
- "prompt_number": 40
+ "outputs": []
},
{
"cell_type": "code",
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "10 loops, best of 3: 107 ms per loop\n"
- ]
- }
- ],
- "prompt_number": 41
+ "outputs": []
},
{
"cell_type": "code",
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "10 loops, best of 3: 107 ms per loop\n"
- ]
- }
- ],
- "prompt_number": 42
+ "outputs": []
},
{
"cell_type": "code",
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "10 loops, best of 3: 174 ms per loop\n"
- ]
- }
- ],
- "prompt_number": 43
+ "outputs": []
},
{
"cell_type": "code",
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "10 loops, best of 3: 86.6 ms per loop\n"
- ]
- }
- ],
- "prompt_number": 45
+ "outputs": []
},
{
"cell_type": "code",
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "10 loops, best of 3: 30.4 ms per loop\n"
- ]
- }
- ],
- "prompt_number": 46
+ "outputs": []
},
{
"cell_type": "code",
"input": [],
"language": "python",
"metadata": {},
- "outputs": [],
- "prompt_number": 46
+ "outputs": []
}
],
"metadata": {}