@@ -81,7 +81,6 @@ Let's take a look and see where the time is spent during this operation
81
81
using the `prun ipython magic function <https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-prun >`__:
82
82
83
83
.. ipython :: python
84
- :okexcept:
85
84
86
85
# most time consuming 4 calls
87
86
% prun - l 4 df.apply(lambda x : integrate_f(x[' a' ], x[' b' ], x[' N' ]), axis = 1 )
@@ -164,7 +163,6 @@ the index and the series (three times for each row). These Python function calls
164
163
can be improved by passing an ``np.ndarray ``.
165
164
166
165
.. ipython :: python
167
- :okexcept:
168
166
169
167
% prun - l 4 df.apply(lambda x : integrate_f_typed(x[' a' ], x[' b' ], x[' N' ]), axis = 1 )
170
168
@@ -205,7 +203,6 @@ Since ``apply_integrate_f`` is typed to accept an ``np.ndarray``, :meth:`Series.
205
203
calls are needed to utilize this function.
206
204
207
205
.. ipython :: python
208
- :okexcept:
209
206
210
207
% timeit apply_integrate_f(df[' a' ].to_numpy(), df[' b' ].to_numpy(), df[' N' ].to_numpy())
211
208
@@ -220,7 +217,6 @@ The majority of the time is now spent in ``apply_integrate_f``. Disabling Cython
220
217
and ``wraparound `` checks can yield more performance.
221
218
222
219
.. ipython :: python
223
- :okexcept:
224
220
225
221
% prun - l 4 apply_integrate_f(df[' a' ].to_numpy(), df[' b' ].to_numpy(), df[' N' ].to_numpy())
226
222
@@ -256,7 +252,6 @@ and ``wraparound`` checks can yield more performance.
256
252
...:
257
253
258
254
.. ipython :: python
259
- :okexcept:
260
255
261
256
% timeit apply_integrate_f_wrap(df[' a' ].to_numpy(), df[' b' ].to_numpy(), df[' N' ].to_numpy())
262
257
@@ -534,7 +529,6 @@ name in an expression.
534
529
isn't defined in that context.
535
530
536
531
.. ipython :: python
537
- :okexcept:
538
532
539
533
a, b = 1 , 2
540
534
pd.eval(" @a + b" )
0 commit comments