From 1a14c0e21fd664a215b3744478ca2885923fb011 Mon Sep 17 00:00:00 2001 From: thoo Date: Mon, 14 Jan 2019 15:06:19 -0500 Subject: [PATCH 1/5] Fix flake8-rst errors --- doc/source/enhancingperf.rst | 102 ++++++++++++++++++----------------- setup.cfg | 1 - 2 files changed, 53 insertions(+), 50 deletions(-) diff --git a/doc/source/enhancingperf.rst b/doc/source/enhancingperf.rst index a4a96eea4d8e2..e9052b44dac99 100644 --- a/doc/source/enhancingperf.rst +++ b/doc/source/enhancingperf.rst @@ -73,7 +73,7 @@ four calls) using the `prun ipython magic function Date: Mon, 14 Jan 2019 15:09:30 -0500 Subject: [PATCH 2/5] remove () --- doc/source/enhancingperf.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/enhancingperf.rst b/doc/source/enhancingperf.rst index e9052b44dac99..5a6d525b5d10f 100644 --- a/doc/source/enhancingperf.rst +++ b/doc/source/enhancingperf.rst @@ -286,7 +286,7 @@ advanced Cython techniques: .. code-block:: ipython - In [4]: %timeit (apply_integrate_f_wrap(df['a'].values, df['b'].values, df['N'].values) + In [4]: %timeit apply_integrate_f_wrap(df['a'].values, df['b'].values, df['N'].values 1000 loops, best of 3: 987 us per loop Even faster, with the caveat that a bug in our Cython code (an off-by-one error, From 3119562324f92f5ecf95e17b76bdd4a4a265f19c Mon Sep 17 00:00:00 2001 From: thoo Date: Mon, 14 Jan 2019 15:10:41 -0500 Subject: [PATCH 3/5] add ) --- doc/source/enhancingperf.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/enhancingperf.rst b/doc/source/enhancingperf.rst index 5a6d525b5d10f..f4fcdedd8acec 100644 --- a/doc/source/enhancingperf.rst +++ b/doc/source/enhancingperf.rst @@ -286,7 +286,7 @@ advanced Cython techniques: .. code-block:: ipython - In [4]: %timeit apply_integrate_f_wrap(df['a'].values, df['b'].values, df['N'].values + In [4]: %timeit apply_integrate_f_wrap(df['a'].values, df['b'].values, df['N'].values) 1000 loops, best of 3: 987 us per loop Even faster, with the caveat that a bug in our Cython code (an off-by-one error, From 37b96f0bbed3a678bc1af9269307ef80abdb26e4 Mon Sep 17 00:00:00 2001 From: thoo Date: Mon, 14 Jan 2019 15:14:12 -0500 Subject: [PATCH 4/5] undone unnecessary spaces --- doc/source/enhancingperf.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/enhancingperf.rst b/doc/source/enhancingperf.rst index f4fcdedd8acec..da2db3e4f1f75 100644 --- a/doc/source/enhancingperf.rst +++ b/doc/source/enhancingperf.rst @@ -549,11 +549,11 @@ Now let's do the same thing but with comparisons: Operations such as - .. code-block:: python + .. code-block:: python - 1 and 2 # would parse to 1 & 2, but should evaluate to 2 - 3 or 4 # would parse to 3 | 4, but should evaluate to 3 - ~1 # this is okay, but slower when using eval + 1 and 2 # would parse to 1 & 2, but should evaluate to 2 + 3 or 4 # would parse to 3 | 4, but should evaluate to 3 + ~1 # this is okay, but slower when using eval should be performed in Python. An exception will be raised if you try to perform any boolean/bitwise operations with scalar operands that are not From d01ac2bcbf06e25ba21c127b2e55671fbb8fedfc Mon Sep 17 00:00:00 2001 From: thoo Date: Mon, 14 Jan 2019 15:15:41 -0500 Subject: [PATCH 5/5] fix with_numba --- doc/source/enhancingperf.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/enhancingperf.rst b/doc/source/enhancingperf.rst index da2db3e4f1f75..0e3d389aa4f6e 100644 --- a/doc/source/enhancingperf.rst +++ b/doc/source/enhancingperf.rst @@ -394,7 +394,7 @@ Consider the following toy example of doubling each observation: 1000 loops, best of 3: 233 us per loop # Custom function with numba - In [7]: %timeit (df['col1_doubled'] = double_every_value_with_numba(df.a.values) + In [7]: %timeit (df['col1_doubled'] = double_every_value_withnumba(df.a.values) 1000 loops, best of 3: 145 us per loop Caveats