Skip to content

Commit dd3b509

Browse files
committed
Merge branch 'master' of https://github.com/pandas-dev/pandas into sty-private
2 parents 9013bcd + 76f74d5 commit dd3b509

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+3123
-409
lines changed

ci/deps/azure-37-locale_slow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
- lxml
1919
- matplotlib=3.0.0
2020
- numpy=1.16.*
21-
- openpyxl=2.5.7
21+
- openpyxl=2.6.0
2222
- python-dateutil
2323
- python-blosc
2424
- pytz=2017.3

ci/deps/azure-37-minimum_versions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- numba=0.46.0
2020
- numexpr=2.6.8
2121
- numpy=1.16.5
22-
- openpyxl=2.5.7
22+
- openpyxl=2.6.0
2323
- pytables=3.4.4
2424
- python-dateutil=2.7.3
2525
- pytz=2017.3

doc/source/getting_started/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ html5lib 1.0.1 HTML parser for read_html (see :ref
274274
lxml 4.3.0 HTML parser for read_html (see :ref:`note <optional_html>`)
275275
matplotlib 2.2.3 Visualization
276276
numba 0.46.0 Alternative execution engine for rolling operations
277-
openpyxl 2.5.7 Reading / writing for xlsx files
277+
openpyxl 2.6.0 Reading / writing for xlsx files
278278
pandas-gbq 0.12.0 Google Big Query access
279279
psycopg2 2.7 PostgreSQL engine for sqlalchemy
280280
pyarrow 0.15.0 Parquet, ORC, and feather reading / writing

doc/source/user_guide/computation.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ compute the mean absolute deviation on a rolling basis:
361361
@savefig rolling_apply_ex.png
362362
s.rolling(window=60).apply(mad, raw=True).plot(style='k')
363363
364+
Using the Numba engine
365+
~~~~~~~~~~~~~~~~~~~~~~
366+
364367
.. versionadded:: 1.0
365368

366369
Additionally, :meth:`~Rolling.apply` can leverage `Numba <https://numba.pydata.org/>`__

doc/source/user_guide/enhancingperf.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,13 @@ nicer interface by passing/returning pandas objects.
373373
374374
In this example, using Numba was faster than Cython.
375375

376+
Numba as an argument
377+
~~~~~~~~~~~~~~~~~~~~
378+
379+
Additionally, we can leverage the power of `Numba <https://numba.pydata.org/>`__
380+
by calling it as an argument in :meth:`~Rolling.apply`. See :ref:`Computation tools
381+
<stats.rolling_apply>` for an extensive example.
382+
376383
Vectorize
377384
~~~~~~~~~
378385

doc/source/whatsnew/v1.1.2.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ Bug fixes
3232
- Bug in :meth:`DataFrame.apply` with ``result_type="reduce"`` returning with incorrect index (:issue:`35683`)
3333
- Bug in :meth:`DateTimeIndex.format` and :meth:`PeriodIndex.format` with ``name=True`` setting the first item to ``"None"`` where it should bw ``""`` (:issue:`35712`)
3434
- Bug in :meth:`Float64Index.__contains__` incorrectly raising ``TypeError`` instead of returning ``False`` (:issue:`35788`)
35+
- Bug in :class:`DataFrame` indexing returning an incorrect :class:`Series` in some cases when the series has been altered and a cache not invalidated (:issue:`36051`)
36+
37+
.. ---------------------------------------------------------------------------
38+
39+
.. _whatsnew_112.other:
40+
41+
Other
42+
~~~~~
43+
- :meth:`factorize` now supports ``na_sentinel=None`` to include NaN in the uniques of the values and remove ``dropna`` keyword which was unintentionally exposed to public facing API in 1.1 version from :meth:`factorize`(:issue:`35667`)
3544

3645
.. ---------------------------------------------------------------------------
3746

doc/source/whatsnew/v1.2.0.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Optional libraries below the lowest tested version may still work, but are not c
109109
+-----------------+-----------------+---------+
110110
| numba | 0.46.0 | |
111111
+-----------------+-----------------+---------+
112-
| openpyxl | 2.5.7 | |
112+
| openpyxl | 2.6.0 | X |
113113
+-----------------+-----------------+---------+
114114
| pyarrow | 0.15.0 | X |
115115
+-----------------+-----------------+---------+
@@ -176,7 +176,8 @@ Datetimelike
176176
- Bug in :attr:`DatetimeArray.date` where a ``ValueError`` would be raised with a read-only backing array (:issue:`33530`)
177177
- Bug in ``NaT`` comparisons failing to raise ``TypeError`` on invalid inequality comparisons (:issue:`35046`)
178178
- Bug in :class:`DateOffset` where attributes reconstructed from pickle files differ from original objects when input values exceed normal ranges (e.g months=12) (:issue:`34511`)
179-
-
179+
- Bug in :meth:`DatetimeIndex.get_slice_bound` where ``datetime.date`` objects were not accepted or naive :class:`Timestamp` with a tz-aware :class:`DatetimeIndex` (:issue:`35690`)
180+
- Bug in :meth:`DatetimeIndex.slice_locs` where ``datetime.date`` objects were not accepted (:issue:`34077`)
180181

181182
Timedelta
182183
^^^^^^^^^
@@ -217,7 +218,7 @@ Interval
217218

218219
Indexing
219220
^^^^^^^^
220-
221+
- Bug in :meth:`PeriodIndex.get_loc` incorrectly raising ``ValueError`` on non-datelike strings instead of ``KeyError``, causing similar errors in :meth:`Series.__geitem__`, :meth:`Series.__contains__`, and :meth:`Series.loc.__getitem__` (:issue:`34240`)
221222
-
222223
-
223224

@@ -256,6 +257,7 @@ Groupby/resample/rolling
256257
- Bug in :meth:`DataFrameGroupBy.apply` where a non-nuisance grouping column would be dropped from the output columns if another groupby method was called before ``.apply()`` (:issue:`34656`)
257258
- Bug in :meth:`DataFrameGroupby.apply` would drop a :class:`CategoricalIndex` when grouped on. (:issue:`35792`)
258259
- Bug when subsetting columns on a :class:`~pandas.core.groupby.DataFrameGroupBy` (e.g. ``df.groupby('a')[['b']])``) would reset the attributes ``axis``, ``dropna``, ``group_keys``, ``level``, ``mutated``, ``sort``, and ``squeeze`` to their default values. (:issue:`9959`)
260+
- Bug in :meth:`DataFrameGroupby.tshift` failing to raise ``ValueError`` when a frequency cannot be inferred for the index of a group (:issue:`35937`)
259261
-
260262

261263
Reshaping
@@ -281,7 +283,7 @@ ExtensionArray
281283

282284
Other
283285
^^^^^
284-
-
286+
- Bug in :meth:`DataFrame.replace` and :meth:`Series.replace` incorrectly raising ``AssertionError`` instead of ``ValueError`` when invalid parameter combinations are passed (:issue:`36045`)
285287
-
286288

287289
.. ---------------------------------------------------------------------------

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- flake8-comprehensions>=3.1.0 # used by flake8, linting of unnecessary comprehensions
2222
- flake8-rst>=0.6.0,<=0.7.0 # linting of code blocks in rst files
2323
- isort>=5.2.1 # check that imports are in the right order
24-
- mypy=0.730
24+
- mypy=0.782
2525
- pycodestyle # used by flake8
2626

2727
# documentation

pandas/_config/config.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,7 @@ def register_option(
460460
path = key.split(".")
461461

462462
for k in path:
463-
# NOTE: tokenize.Name is not a public constant
464-
# error: Module has no attribute "Name" [attr-defined]
465-
if not re.match("^" + tokenize.Name + "$", k): # type: ignore[attr-defined]
463+
if not re.match("^" + tokenize.Name + "$", k):
466464
raise ValueError(f"{k} is not a valid identifier")
467465
if keyword.iskeyword(k):
468466
raise ValueError(f"{k} is a python keyword")

pandas/_libs/reduction.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ cdef class _BaseGrouper:
5353
# to a 1-d ndarray like datetime / timedelta / period.
5454
object.__setattr__(cached_ityp, '_index_data', islider.buf)
5555
cached_ityp._engine.clear_mapping()
56+
cached_ityp._cache.clear() # e.g. inferred_freq must go
5657
object.__setattr__(cached_typ._mgr._block, 'values', vslider.buf)
5758
object.__setattr__(cached_typ._mgr._block, 'mgr_locs',
5859
slice(len(vslider.buf)))
@@ -71,6 +72,7 @@ cdef class _BaseGrouper:
7172
object res
7273

7374
cached_ityp._engine.clear_mapping()
75+
cached_ityp._cache.clear() # e.g. inferred_freq must go
7476
res = self.f(cached_typ)
7577
res = _extract_result(res)
7678
if not initialized:
@@ -455,6 +457,7 @@ cdef class BlockSlider:
455457

456458
object.__setattr__(self.index, '_index_data', self.idx_slider.buf)
457459
self.index._engine.clear_mapping()
460+
self.index._cache.clear() # e.g. inferred_freq must go
458461

459462
cdef reset(self):
460463
cdef:

pandas/_vendored/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)