Skip to content

Commit 6657841

Browse files
committed
Merge remote-tracking branch 'upstream/master' into styler_apply
2 parents 1395b65 + aa97540 commit 6657841

File tree

105 files changed

+2488
-2001
lines changed

Some content is hidden

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

105 files changed

+2488
-2001
lines changed

.github/workflows/comment_bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Install-pre-commit
3030
run: python -m pip install --upgrade pre-commit
3131
- name: Run pre-commit
32-
run: pre-commit run --all-files || (exit 0)
32+
run: pre-commit run --from-ref=origin/master --to-ref=HEAD --all-files || (exit 0)
3333
- name: Commit results
3434
run: |
3535
git config user.name "$(git log -1 --pretty=format:%an)"

asv_bench/benchmarks/series_methods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ def setup(self):
108108
self.vals_short = np.arange(2).astype(object)
109109
self.vals_long = np.arange(10 ** 5).astype(object)
110110
# because of nans floats are special:
111-
self.s_long_floats = Series(np.arange(10 ** 5, dtype=np.float)).astype(object)
112-
self.vals_long_floats = np.arange(10 ** 5, dtype=np.float).astype(object)
111+
self.s_long_floats = Series(np.arange(10 ** 5, dtype=np.float_)).astype(object)
112+
self.vals_long_floats = np.arange(10 ** 5, dtype=np.float_).astype(object)
113113

114114
def time_isin_nans(self):
115115
# if nan-objects are different objects,

ci/deps/actions-37-locale.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
- hypothesis>=3.58.0
1212

1313
# required
14-
- numpy
14+
- numpy<1.20 # GH#39541 compat for pyarrow<3
1515
- python-dateutil
1616
- pytz
1717

ci/deps/azure-37.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
- numpy
1919
- python-dateutil
2020
- nomkl
21-
- pyarrow
21+
- pyarrow=0.15.1
2222
- pytz
2323
- s3fs>=0.4.0
2424
- moto>=1.3.14

ci/deps/azure-38-locale.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies:
2424
- moto
2525
- nomkl
2626
- numexpr
27-
- numpy
27+
- numpy<1.20 # GH#39541 compat with pyarrow<3
2828
- openpyxl
2929
- pytables
3030
- python-dateutil

ci/deps/azure-macos-37.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- numexpr
2222
- numpy=1.16.5
2323
- openpyxl
24-
- pyarrow>=0.15.0
24+
- pyarrow=0.15.1
2525
- pytables
2626
- python-dateutil==2.7.3
2727
- pytz

doc/source/user_guide/enhancingperf.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ in Python, so maybe we could minimize these by cythonizing the apply part.
199199
...: return s * dx
200200
...: cpdef np.ndarray[double] apply_integrate_f(np.ndarray col_a, np.ndarray col_b,
201201
...: np.ndarray col_N):
202-
...: assert (col_a.dtype == np.float
203-
...: and col_b.dtype == np.float and col_N.dtype == np.int)
202+
...: assert (col_a.dtype == np.float_
203+
...: and col_b.dtype == np.float_ and col_N.dtype == np.int_)
204204
...: cdef Py_ssize_t i, n = len(col_N)
205205
...: assert (len(col_a) == len(col_b) == n)
206206
...: cdef np.ndarray[double] res = np.empty(n)

doc/source/whatsnew/v0.8.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ New plotting methods
176176
Vytautas Jancauskas, the 2012 GSOC participant, has added many new plot
177177
types. For example, ``'kde'`` is a new option:
178178

179-
.. code-block:: python
179+
.. ipython:: python
180180
181181
s = pd.Series(
182182
np.concatenate((np.random.randn(1000), np.random.randn(1000) * 0.5 + 3))

doc/source/whatsnew/v1.2.2.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ including other versions of pandas.
1414

1515
Fixed regressions
1616
~~~~~~~~~~~~~~~~~
17+
18+
- Fixed regression in :func:`read_excel` that caused it to raise ``AttributeError`` when checking version of older xlrd versions (:issue:`38955`)
19+
- Fixed regression in :class:`DataFrame` constructor reordering element when construction from datetime ndarray with dtype not ``"datetime64[ns]"`` (:issue:`39422`)
1720
- Fixed regression in :meth:`~DataFrame.to_pickle` failing to create bz2/xz compressed pickle files with ``protocol=5`` (:issue:`39002`)
1821
- Fixed regression in :func:`pandas.testing.assert_series_equal` and :func:`pandas.testing.assert_frame_equal` always raising ``AssertionError`` when comparing extension dtypes (:issue:`39410`)
1922
- Fixed regression in :meth:`~DataFrame.to_csv` opening ``codecs.StreamWriter`` in binary mode instead of in text mode and ignoring user-provided ``mode`` (:issue:`39247`)
@@ -26,7 +29,7 @@ Fixed regressions
2629
Bug fixes
2730
~~~~~~~~~
2831

29-
-
32+
- :func:`pandas.read_excel` error message when a specified ``sheetname`` does not exist is now uniform across engines (:issue:`39250`)
3033
-
3134

3235
.. ---------------------------------------------------------------------------

doc/source/whatsnew/v1.3.0.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Other enhancements
5656
- :meth:`.Styler.set_tooltips` allows on hover tooltips to be added to styled HTML dataframes. (:issue:`39317`)
5757
- :meth:`.Styler.apply` now more consistently accepts ndarray function returns, i.e. in all cases for ``axis`` is ``0, 1 or None``. (:issue:`39359`)
5858
- :meth:`Series.loc.__getitem__` and :meth:`Series.loc.__setitem__` with :class:`MultiIndex` now raising helpful error message when indexer has too many dimensions (:issue:`35349`)
59+
- :meth:`pandas.read_stata` and :class:`StataReader` support reading data from compressed files.
5960

6061
.. ---------------------------------------------------------------------------
6162
@@ -275,7 +276,6 @@ Datetimelike
275276
- Bug in constructing a :class:`DataFrame` or :class:`Series` with mismatched ``datetime64`` data and ``timedelta64`` dtype, or vice-versa, failing to raise ``TypeError`` (:issue:`38575`, :issue:`38764`, :issue:`38792`)
276277
- Bug in constructing a :class:`Series` or :class:`DataFrame` with a ``datetime`` object out of bounds for ``datetime64[ns]`` dtype or a ``timedelta`` object out of bounds for ``timedelta64[ns]`` dtype (:issue:`38792`, :issue:`38965`)
277278
- Bug in :meth:`DatetimeIndex.intersection`, :meth:`DatetimeIndex.symmetric_difference`, :meth:`PeriodIndex.intersection`, :meth:`PeriodIndex.symmetric_difference` always returning object-dtype when operating with :class:`CategoricalIndex` (:issue:`38741`)
278-
- Bug in :class:`DataFrame` constructor reordering element when construction from datetime ndarray with dtype not ``"datetime64[ns]"`` (:issue:`39422`)
279279
- Bug in :meth:`Series.where` incorrectly casting ``datetime64`` values to ``int64`` (:issue:`37682`)
280280
- Bug in :class:`Categorical` incorrectly typecasting ``datetime`` object to ``Timestamp`` (:issue:`38878`)
281281
- Bug in comparisons between :class:`Timestamp` object and ``datetime64`` objects just outside the implementation bounds for nanosecond ``datetime64`` (:issue:`39221`)
@@ -285,7 +285,7 @@ Datetimelike
285285
Timedelta
286286
^^^^^^^^^
287287
- Bug in constructing :class:`Timedelta` from ``np.timedelta64`` objects with non-nanosecond units that are out of bounds for ``timedelta64[ns]`` (:issue:`38965`)
288-
-
288+
- Bug in constructing a :class:`TimedeltaIndex` incorrectly accepting ``np.datetime64("NaT")`` objects (:issue:`39462`)
289289
-
290290

291291
Timezones
@@ -377,6 +377,7 @@ I/O
377377
- Bug in :func:`read_csv` not switching ``true_values`` and ``false_values`` for nullable ``boolean`` dtype (:issue:`34655`)
378378
- Bug in :func:`read_json` when ``orient="split"`` does not maintain numeric string index (:issue:`28556`)
379379
- :meth:`read_sql` returned an empty generator if ``chunksize`` was no-zero and the query returned no results. Now returns a generator with a single empty dataframe (:issue:`34411`)
380+
- Bug in :func:`read_hdf` returning unexpected records when filtering on categorical string columns using ``where`` parameter (:issue:`39189`)
380381

381382
Period
382383
^^^^^^
@@ -412,7 +413,7 @@ Reshaping
412413
- Bug in :meth:`DataFrame.join` not assigning values correctly when having :class:`MultiIndex` where at least one dimension is from dtype ``Categorical`` with non-alphabetically sorted categories (:issue:`38502`)
413414
- :meth:`Series.value_counts` and :meth:`Series.mode` return consistent keys in original order (:issue:`12679`, :issue:`11227` and :issue:`39007`)
414415
- Bug in :meth:`DataFrame.apply` would give incorrect results when used with a string argument and ``axis=1`` when the axis argument was not supported and now raises a ``ValueError`` instead (:issue:`39211`)
415-
-
416+
- Bug in :meth:`DataFrame.append` returning incorrect dtypes with combinations of ``ExtensionDtype`` dtypes (:issue:`39454`)
416417

417418
Sparse
418419
^^^^^^
@@ -433,7 +434,7 @@ Other
433434
- Bug in :class:`Index` constructor sometimes silently ignorning a specified ``dtype`` (:issue:`38879`)
434435
- Bug in constructing a :class:`Series` from a list and a :class:`PandasDtype` (:issue:`39357`)
435436
- Bug in :class:`Styler` which caused CSS to duplicate on multiple renders. (:issue:`39395`)
436-
-
437+
- Bug in :func:`pandas.testing.assert_series_equal`, :func:`pandas.testing.assert_frame_equal`, :func:`pandas.testing.assert_index_equal` and :func:`pandas.testing.assert_extension_array_equal` incorrectly raising when an attribute has an unrecognized NA type (:issue:`39461`)
437438

438439
.. ---------------------------------------------------------------------------
439440

0 commit comments

Comments
 (0)