Skip to content

Commit 18928c8

Browse files
DOC: fix table in whatsnew
1 parent 355b462 commit 18928c8

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed

doc/source/whatsnew/v0.17.0.txt

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,30 @@ New features
3131
- Enable writing complex values to HDF stores when using table format (:issue:`10447`)
3232
- Enable reading gzip compressed files via URL, either by explicitly setting the compression parameter or by inferring from the presence of the HTTP Content-Encoding header in the response (:issue:`8685`)
3333

34+
35+
.. _whatsnew_0170.gil:
36+
37+
Releasing the GIL
38+
^^^^^^^^^^^^^^^^^
39+
40+
We are releasing the global-interpreter-lock (GIL) on some cython operations.
41+
This will allow other threads to run simultaneously during computation, potentially allowing performance improvements
42+
from multi-threading. Notably ``groupby`` and some indexing operations are a benefit from this. (:issue:`8882`)
43+
44+
For example the groupby expression in the following code will have the GIL released during the factorization step, e.g. ``df.groupby('key')``
45+
as well as the ``.sum()`` operation.
46+
47+
.. code-block:: python
48+
49+
N = 1e6
50+
df = DataFrame({'key' : np.random.randint(0,ngroups,size=N),
51+
'data' : np.random.randn(N) })
52+
df.groupby('key')['data'].sum()
53+
54+
Releasing of the GIL could benefit an application that uses threads for user interactions (e.g. ``QT``), or performaning multi-threaded computations. A nice example of a library that can handle these types of computation-in-parallel is the dask_ library.
55+
56+
.. _dask: https://dask.readthedocs.org/en/latest/
57+
3458
.. _whatsnew_0170.enhancements.other:
3559

3660
Other enhancements
@@ -277,14 +301,15 @@ Other API Changes
277301
- ``Categorical.name`` was removed to make `Categorical` more ``numpy.ndarray`` like. Use ``Series(cat, name="whatever")`` instead (:issue:`10482`).
278302

279303
- ``NaT``'s methods now either raise ``ValueError``, or return ``np.nan`` or ``NaT`` (:issue:`9513`)
280-
=========================== ==============================================================
281-
Behavior Methods
282-
=========================== ==============================================================
283-
``return np.nan`` ``weekday``, ``isoweekday``
284-
``return NaT`` ``date``, ``now``, ``replace``, ``to_datetime``, ``today``
285-
``return np.datetime64('NaT')`` ``to_datetime64`` (unchanged)
286-
``raise ValueError`` All other public methods (names not beginning with underscores)
287-
=========================== ===============================================================
304+
305+
=============================== ==============================================================
306+
Behavior Methods
307+
=============================== ==============================================================
308+
``return np.nan`` ``weekday``, ``isoweekday``
309+
``return NaT`` ``date``, ``now``, ``replace``, ``to_datetime``, ``today``
310+
``return np.datetime64('NaT')`` ``to_datetime64`` (unchanged)
311+
``raise ValueError`` All other public methods (names not beginning with underscores)
312+
=============================== ===============================================================
288313

289314
.. _whatsnew_0170.deprecations:
290315

@@ -298,29 +323,6 @@ Removal of prior version deprecations/changes
298323

299324
- Remove use of some deprecated numpy comparison operations, mainly in tests. (:issue:`10569`)
300325

301-
.. _dask: https://dask.readthedocs.org/en/latest/
302-
303-
.. _whatsnew_0170.gil:
304-
305-
Releasing the GIL
306-
~~~~~~~~~~~~~~~~~
307-
308-
We are releasing the global-interpreter-lock (GIL) on some cython operations.
309-
This will allow other threads to run simultaneously during computation, potentially allowing performance improvements
310-
from multi-threading. Notably ``groupby`` and some indexing operations are a benefit from this. (:issue:`8882`)
311-
312-
For example the groupby expression in the following code will have the GIL released during the factorization step, e.g. ``df.groupby('key')``
313-
as well as the ``.sum()`` operation.
314-
315-
.. code-block:: python
316-
317-
N = 1e6
318-
df = DataFrame({'key' : np.random.randint(0,ngroups,size=N),
319-
'data' : np.random.randn(N) })
320-
df.groupby('key')['data'].sum()
321-
322-
Releasing of the GIL could benefit an application that uses threads for user interactions (e.g. ``QT``), or performaning multi-threaded computations. A nice example of a library that can handle these types of computation-in-parallel is the dask_ library.
323-
324326

325327
.. _whatsnew_0170.performance:
326328

0 commit comments

Comments
 (0)