|
@@ -1169,7 +1169,18 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 51,
|
|
|
+ "execution_count": 2,
|
|
|
+ "metadata": {
|
|
|
+ "collapsed": true
|
|
|
+ },
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "import numpy as np"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 3,
|
|
|
"metadata": {
|
|
|
"collapsed": true,
|
|
|
"slideshow": {
|
|
@@ -1183,7 +1194,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 52,
|
|
|
+ "execution_count": 4,
|
|
|
"metadata": {
|
|
|
"collapsed": false,
|
|
|
"slideshow": {
|
|
@@ -1195,7 +1206,7 @@
|
|
|
"name": "stdout",
|
|
|
"output_type": "stream",
|
|
|
"text": [
|
|
|
- "1000 loops, best of 3: 558 µs per loop\n"
|
|
|
+ "1000 loops, best of 3: 519 µs per loop\n"
|
|
|
]
|
|
|
}
|
|
|
],
|
|
@@ -1205,7 +1216,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 53,
|
|
|
+ "execution_count": 5,
|
|
|
"metadata": {
|
|
|
"collapsed": true,
|
|
|
"slideshow": {
|
|
@@ -1219,7 +1230,7 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 54,
|
|
|
+ "execution_count": 6,
|
|
|
"metadata": {
|
|
|
"collapsed": false,
|
|
|
"slideshow": {
|
|
@@ -1231,8 +1242,8 @@
|
|
|
"name": "stdout",
|
|
|
"output_type": "stream",
|
|
|
"text": [
|
|
|
- "The slowest run took 52.96 times longer than the fastest. This could mean that an intermediate result is being cached \n",
|
|
|
- "100000 loops, best of 3: 2.19 µs per loop\n"
|
|
|
+ "The slowest run took 1538.53 times longer than the fastest. This could mean that an intermediate result is being cached.\n",
|
|
|
+ "100000 loops, best of 3: 1.98 µs per loop\n"
|
|
|
]
|
|
|
}
|
|
|
],
|
|
@@ -1241,6 +1252,26 @@
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 8,
|
|
|
+ "metadata": {
|
|
|
+ "collapsed": false
|
|
|
+ },
|
|
|
+ "outputs": [
|
|
|
+ {
|
|
|
+ "name": "stdout",
|
|
|
+ "output_type": "stream",
|
|
|
+ "text": [
|
|
|
+ "The slowest run took 9.51 times longer than the fastest. This could mean that an intermediate result is being cached.\n",
|
|
|
+ "1000 loops, best of 3: 332 µs per loop\n"
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "source": [
|
|
|
+ "%timeit [element**2 for element in a]"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
"cell_type": "markdown",
|
|
|
"metadata": {
|
|
|
"slideshow": {
|
|
@@ -2672,6 +2703,7 @@
|
|
|
}
|
|
|
],
|
|
|
"metadata": {
|
|
|
+ "celltoolbar": "Slideshow",
|
|
|
"kernelspec": {
|
|
|
"display_name": "Python 3",
|
|
|
"language": "python",
|
|
@@ -2687,7 +2719,7 @@
|
|
|
"name": "python",
|
|
|
"nbconvert_exporter": "python",
|
|
|
"pygments_lexer": "ipython3",
|
|
|
- "version": "3.4.3"
|
|
|
+ "version": "3.5.1"
|
|
|
}
|
|
|
},
|
|
|
"nbformat": 4,
|