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
You can use :class:`pandas.IndexSlice` to facilitate a more natural syntax using ``:``, rather than using ``slice(None)``.
319
+
320
+
You can use :class:`pandas.IndexSlice` to facilitate a more natural syntax
321
+
using ``:``, rather than using ``slice(None)``.
320
322
321
323
.. ipython:: python
322
324
@@ -557,7 +559,7 @@ Take Methods
557
559
558
560
.. _advanced.take:
559
561
560
-
Similar to numpy ndarrays, pandas Index, Series, and DataFrame also provides
562
+
Similar to NumPy ndarrays, pandas Index, Series, and DataFrame also provides
561
563
the ``take`` method that retrieves elements along a given axis at the given
562
564
indices. The given indices must be either a list or an ndarray of integer
563
565
index positions. ``take`` will also accept negative integers as relative positions to the end of the object.
@@ -729,7 +731,7 @@ This is an Immutable array implementing an ordered, sliceable set.
729
731
Prior to 0.18.0, the ``Int64Index`` would provide the default index forall``NDFrame`` objects.
730
732
731
733
``RangeIndex``is a sub-class of ``Int64Index`` added in version 0.18.0, now providing the default index forall``NDFrame`` objects.
732
-
``RangeIndex``is an optimized version of ``Int64Index`` that can represent a monotonic ordered set. These are analogous to python`range types <https://docs.python.org/3/library/stdtypes.html#typesseq-range>`__.
734
+
``RangeIndex``is an optimized version of ``Int64Index`` that can represent a monotonic ordered set. These are analogous to Python`range types <https://docs.python.org/3/library/stdtypes.html#typesseq-range>`__.
733
735
734
736
.. _indexing.float64index:
735
737
@@ -763,7 +765,6 @@ The only positional indexing is via ``iloc``.
763
765
sf.iloc[3]
764
766
765
767
A scalar index that isnot found will raise a ``KeyError``.
766
-
767
768
Slicing is primarily on the values of the index when using ``[],ix,loc``, and
768
769
**always** positional when using ``iloc``. The exception is when the sliceis
769
770
boolean, in which case it will always be positional.
Copy file name to clipboardExpand all lines: doc/source/enhancingperf.rst
+9-9
Original file line number
Diff line number
Diff line change
@@ -24,13 +24,13 @@ Enhancing Performance
24
24
Cython (Writing C extensions for pandas)
25
25
----------------------------------------
26
26
27
-
For many use cases writing pandas in pure python and numpy is sufficient. In some
27
+
For many use cases writing pandas in pure Python and NumPy is sufficient. In some
28
28
computationally heavy applications however, it can be possible to achieve sizeable
29
29
speed-ups by offloading work to `cython <http://cython.org/>`__.
30
30
31
31
This tutorial assumes you have refactored as much as possible in python, for example
32
-
trying to remove for loops and making use of numpy vectorization, it's always worth
33
-
optimising in python first.
32
+
trying to remove for loops and making use of NumPy vectorization, it's always worth
33
+
optimising in Python first.
34
34
35
35
This tutorial walks through a "typical" process of cythonizing a slow computation.
36
36
We use an `example from the cython documentation <http://docs.cython.org/src/quickstart/cythonize.html>`__
@@ -86,8 +86,8 @@ hence we'll concentrate our efforts cythonizing these two functions.
86
86
87
87
.. note::
88
88
89
-
In python 2 replacing the ``range`` with its generator counterpart (``xrange``)
90
-
would mean the ``range`` line would vanish. In python 3 ``range`` is already a generator.
89
+
In Python 2 replacing the ``range`` with its generator counterpart (``xrange``)
90
+
would mean the ``range`` line would vanish. In Python 3 ``range`` is already a generator.
91
91
92
92
.. _enhancingperf.plain:
93
93
@@ -232,7 +232,7 @@ the rows, applying our ``integrate_f_typed``, and putting this in the zeros arra
232
232
.. note::
233
233
234
234
Loops like this would be *extremely* slow in python, but in Cython looping
235
-
over numpy arrays is *fast*.
235
+
over NumPy arrays is *fast*.
236
236
237
237
.. code-block:: ipython
238
238
@@ -315,7 +315,7 @@ Numba works by generating optimized machine code using the LLVM compiler infrast
315
315
Jit
316
316
~~~
317
317
318
-
Using ``numba`` to just-in-time compile your code. We simply take the plain python code from above and annotate with the ``@jit`` decorator.
318
+
Using ``numba`` to just-in-time compile your code. We simply take the plain Python code from above and annotate with the ``@jit`` decorator.
319
319
320
320
.. code-block:: python
321
321
@@ -391,7 +391,7 @@ Caveats
391
391
392
392
``numba`` will execute on any function, but can only accelerate certain classes of functions.
393
393
394
-
``numba`` is best at accelerating functions that apply numerical functions to numpy arrays. When passed a function that only uses operations it knows how to accelerate, it will execute in ``nopython`` mode.
394
+
``numba`` is best at accelerating functions that apply numerical functions to NumPy arrays. When passed a function that only uses operations it knows how to accelerate, it will execute in ``nopython`` mode.
395
395
396
396
If ``numba`` is passed a function that includes something it doesn't know how to work with -- a category that currently includes sets, lists, dictionaries, or string functions -- it will revert to ``object mode``. In ``object mode``, numba will execute but your code will not speed up significantly. If you would prefer that ``numba`` throw an error if it cannot compile a function in a way that speeds up your code, pass numba the argument ``nopython=True`` (e.g. ``@numba.jit(nopython=True)``). For more on troubleshooting ``numba`` modes, see the `numba troubleshooting page <http://numba.pydata.org/numba-doc/0.20.0/user/troubleshoot.html#the-compiled-code-is-too-slow>`__.
0 commit comments