You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/enhancingperf.rst
+4-4
Original file line number
Diff line number
Diff line change
@@ -28,14 +28,14 @@ Cython (Writing C extensions for pandas)
28
28
29
29
For many use cases writing pandas in pure python and numpy is sufficient. In some
30
30
computationally heavy applications however, it can be possible to achieve sizeable
31
-
speed-ups by offloading work to `cython <http://cython.org/>`_.
31
+
speed-ups by offloading work to `cython <http://cython.org/>`__.
32
32
33
33
This tutorial assumes you have refactored as much as possible in python, for example
34
34
trying to remove for loops and making use of numpy vectorization, it's always worth
35
35
optimising in python first.
36
36
37
37
This tutorial walks through a "typical" process of cythonizing a slow computation.
38
-
We use an `example from the cython documentation <http://docs.cython.org/src/quickstart/cythonize.html>`_
38
+
We use an `example from the cython documentation <http://docs.cython.org/src/quickstart/cythonize.html>`__
39
39
but in the context of pandas. Our final cythonized solution is around 100 times
40
40
faster than the pure python.
41
41
@@ -73,7 +73,7 @@ We achieve our result by by using ``apply`` (row-wise):
73
73
74
74
But clearly this isn't fast enough for us. Let's take a look and see where the
75
75
time is spent during this operation (limited to the most time consuming
76
-
four calls) using the `prun ipython magic function <http://ipython.org/ipython-doc/stable/api/generated/IPython.core.magics.execution.html#IPython.core.magics.execution.ExecutionMagics.prun>`_:
76
+
four calls) using the `prun ipython magic function <http://ipython.org/ipython-doc/stable/api/generated/IPython.core.magics.execution.html#IPython.core.magics.execution.ExecutionMagics.prun>`__:
77
77
78
78
.. ipython:: python
79
79
@@ -270,4 +270,4 @@ Further topics
270
270
271
271
- Loading C modules into cython.
272
272
273
-
Read more in the `cython docs <http://docs.cython.org/>`_.
273
+
Read more in the `cython docs <http://docs.cython.org/>`__.
@@ -65,7 +66,7 @@ operations implemented, most of them are very fast as well.
65
66
It's very possible however that certain functionality that would make your
66
67
life easier is missing. In that case you have several options:
67
68
68
-
1) Open an issue on `Github <https://github.com/pydata/pandas/issues/>`_ , explain your need and the sort of functionality you would like to see implemented.
69
+
1) Open an issue on `Github <https://github.com/pydata/pandas/issues/>`__ , explain your need and the sort of functionality you would like to see implemented.
69
70
2) Fork the repo, Implement the functionality yourself and open a PR
70
71
on Github.
71
72
3) Write a method that performs the operation you are interested in and
@@ -85,7 +86,7 @@ life easier is missing. In that case you have several options:
85
86
return [x for x inself.columns if'foo'in x]
86
87
87
88
pd.DataFrame.just_foo_cols = just_foo_cols # monkey-patch the DataFrame class
0 commit comments