Skip to content

Commit 8084caf

Browse files
committed
Merge remote-tracking branch 'upstream/master' into pd-todatetime-unit_s-float-vs-int
2 parents 1ff89d4 + a0e0571 commit 8084caf

File tree

94 files changed

+1075
-845
lines changed

Some content is hidden

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

94 files changed

+1075
-845
lines changed

.github/workflows/stale-pr.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
with:
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}
1414
stale-pr-message: "This pull request is stale because it has been open for thirty days with no activity."
15-
skip-stale-pr-message: false
15+
skip-stale-pr-message: true
1616
stale-pr-label: "Stale"
17-
exempt-pr-labels: "Needs Review,Blocked"
17+
exempt-pr-labels: "Needs Review,Blocked,Needs Discussion"
1818
days-before-stale: 30
1919
days-before-close: -1
2020
remove-stale-when-updated: true

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: black
66
language_version: python3
77
- repo: https://gitlab.com/pycqa/flake8
8-
rev: 3.7.7
8+
rev: 3.8.3
99
hooks:
1010
- id: flake8
1111
language: python_venv
@@ -25,7 +25,7 @@ repos:
2525
- file
2626
args: [--append-config=flake8/cython-template.cfg]
2727
- repo: https://github.com/pre-commit/mirrors-isort
28-
rev: v4.3.21
28+
rev: v5.2.2
2929
hooks:
3030
- id: isort
3131
language: python_venv

.travis.yml

+1-8
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ matrix:
4242

4343
- arch: arm64
4444
env:
45-
- JOB="3.7, arm64" PYTEST_WORKERS=8 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard)"
45+
- JOB="3.7, arm64" PYTEST_WORKERS=8 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard and not arm_slow)"
4646

4747
- env:
4848
- JOB="3.7, locale" ENV_FILE="ci/deps/travis-37-locale.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"
@@ -58,13 +58,6 @@ matrix:
5858
services:
5959
- mysql
6060
- postgresql
61-
allow_failures:
62-
- arch: arm64
63-
env:
64-
- JOB="3.7, arm64" PYTEST_WORKERS=8 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard)"
65-
- dist: bionic
66-
env:
67-
- JOB="3.9-dev" PATTERN="(not slow and not network and not clipboard)"
6861

6962

7063
before_install:

asv_bench/asv.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
// followed by the pip installed packages).
4040
"matrix": {
4141
"numpy": [],
42-
"Cython": ["0.29.16"],
42+
"Cython": ["0.29.21"],
4343
"matplotlib": [],
4444
"sqlalchemy": [],
4545
"scipy": [],

ci/build39.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
sudo apt-get install build-essential gcc xvfb
55
pip install --no-deps -U pip wheel setuptools
6-
pip install numpy python-dateutil pytz pytest pytest-xdist hypothesis
7-
pip install cython --pre # https://github.com/cython/cython/issues/3395
6+
pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis
87

98
python setup.py build_ext -inplace
109
python -m pip install --no-build-isolation -e .

ci/deps/azure-37-32bit.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ dependencies:
2121
# see comment above
2222
- pip
2323
- pip:
24-
- cython>=0.29.16
24+
- cython>=0.29.21
2525
- numpy>=1.16.5
2626
- pytest>=5.0.1

ci/deps/azure-37-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.7.*
77

88
# tools
9-
- cython>=0.29.16
9+
- cython>=0.29.21
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- pytest-asyncio

ci/deps/azure-37-locale_slow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.7.*
77

88
# tools
9-
- cython>=0.29.16
9+
- cython>=0.29.21
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0

ci/deps/azure-37-minimum_versions.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.7.1
66

77
# tools
8-
- cython=0.29.16
8+
- cython=0.29.21
99
- pytest=5.0.1
1010
- pytest-xdist>=1.21
1111
- hypothesis>=3.58.0

ci/deps/azure-37-slow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.7.*
77

88
# tools
9-
- cython>=0.29.16
9+
- cython>=0.29.21
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0

ci/deps/azure-38-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.8.*
66

77
# tools
8-
- cython>=0.29.16
8+
- cython>=0.29.21
99
- pytest>=5.0.1
1010
- pytest-xdist>=1.21
1111
- pytest-asyncio>=0.12.0

ci/deps/azure-38-numpydev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
- pytz
1515
- pip
1616
- pip:
17-
- cython==0.29.16 # GH#34014
17+
- cython==0.29.21 # GH#34014
1818
- "git+git://github.com/dateutil/dateutil.git"
1919
- "--extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple"
2020
- "--pre"

ci/deps/azure-macos-37.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ dependencies:
3131
- xlwt
3232
- pip
3333
- pip:
34-
- cython>=0.29.16
34+
- cython>=0.29.21
3535
- pyreadstat
3636
- pyxlsb

ci/deps/azure-windows-37.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.7.*
77

88
# tools
9-
- cython>=0.29.16
9+
- cython>=0.29.21
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0

ci/deps/azure-windows-38.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.8.*
77

88
# tools
9-
- cython>=0.29.16
9+
- cython>=0.29.21
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0

ci/deps/travis-37-arm64.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name: pandas-dev
22
channels:
3-
- defaults
43
- conda-forge
54
dependencies:
65
- python=3.7.*
76

87
# tools
9-
- cython>=0.29.13
8+
- cython>=0.29.21
109
- pytest>=5.0.1
1110
- pytest-xdist>=1.21
1211
- hypothesis>=3.58.0

ci/deps/travis-37-cov.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.7.*
77

88
# tools
9-
- cython>=0.29.16
9+
- cython>=0.29.21
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0

ci/deps/travis-37-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.7.*
77

88
# tools
9-
- cython>=0.29.16
9+
- cython>=0.29.21
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0

ci/deps/travis-37.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.7.*
77

88
# tools
9-
- cython>=0.29.16
9+
- cython>=0.29.21
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0

ci/deps/travis-38.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.8.*
77

88
# tools
9-
- cython>=0.29.16
9+
- cython>=0.29.21
1010
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0

ci/setup_env.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ else
4242
fi
4343

4444
if [ "${TRAVIS_CPU_ARCH}" == "arm64" ]; then
45+
sudo apt-get update
4546
sudo apt-get -y install xvfb
46-
CONDA_URL="https://github.com/conda-forge/miniforge/releases/download/4.8.2-1/Miniforge3-4.8.2-1-Linux-aarch64.sh"
47+
CONDA_URL="https://github.com/conda-forge/miniforge/releases/download/4.8.5-0/Miniforge3-4.8.5-0-Linux-aarch64.sh"
4748
else
4849
CONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-$CONDA_OS.sh"
4950
fi

doc/source/ecosystem.rst

+7
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@ HTTP API, and also provides several convenient methods for parsing and analyzing
303303
fredapi makes use of pandas and returns data in a Series or DataFrame. This module requires a FRED API key that
304304
you can obtain for free on the FRED website.
305305

306+
`dataframe_sql <https://github.com/zbrookle/dataframe_sql>`__
307+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308+
``dataframe_sql`` is a Python package that translates SQL syntax directly into
309+
operations on pandas DataFrames. This is useful when migrating from a database to
310+
using pandas or for users more comfortable with SQL looking for a way to interface
311+
with pandas.
312+
306313

307314
.. _ecosystem.domain:
308315

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Instructions for installing from source,
1818
Python version support
1919
----------------------
2020

21-
Officially Python 3.7.1 and above, and 3.8.
21+
Officially Python 3.7.1 and above, 3.8, and 3.9.
2222

2323
Installing pandas
2424
-----------------

doc/source/user_guide/indexing.rst

+16-6
Original file line numberDiff line numberDiff line change
@@ -1480,17 +1480,27 @@ default value.
14801480
s.get('a') # equivalent to s['a']
14811481
s.get('x', default=-1)
14821482
1483-
The :meth:`~pandas.DataFrame.lookup` method
1484-
-------------------------------------------
1483+
.. _indexing.lookup:
1484+
1485+
Looking up values by index/column labels
1486+
----------------------------------------
14851487

14861488
Sometimes you want to extract a set of values given a sequence of row labels
1487-
and column labels, and the ``lookup`` method allows for this and returns a
1488-
NumPy array. For instance:
1489+
and column labels, this can be achieved by ``DataFrame.melt`` combined by filtering the corresponding
1490+
rows with ``DataFrame.loc``. For instance:
14891491

14901492
.. ipython:: python
14911493
1492-
dflookup = pd.DataFrame(np.random.rand(20, 4), columns = ['A', 'B', 'C', 'D'])
1493-
dflookup.lookup(list(range(0, 10, 2)), ['B', 'C', 'A', 'B', 'D'])
1494+
df = pd.DataFrame({'col': ["A", "A", "B", "B"],
1495+
'A': [80, 23, np.nan, 22],
1496+
'B': [80, 55, 76, 67]})
1497+
df
1498+
melt = df.melt('col')
1499+
melt = melt.loc[melt['col'] == melt['variable'], 'value']
1500+
melt.reset_index(drop=True)
1501+
1502+
Formerly this could be achieved with the dedicated ``DataFrame.lookup`` method
1503+
which was deprecated in version 1.2.0.
14941504

14951505
.. _indexing.class:
14961506

doc/source/whatsnew/v1.1.3.rst

+18
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ including other versions of pandas.
1010

1111
.. ---------------------------------------------------------------------------
1212
13+
Enhancements
14+
~~~~~~~~~~~~
15+
16+
Added support for new Python version
17+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
19+
Pandas 1.1.3 now supports Python 3.9 (:issue:`36296`).
20+
21+
Development Changes
22+
^^^^^^^^^^^^^^^^^^^
23+
24+
- The minimum version of Cython is now the most recent bug-fix version (0.29.21) (:issue:`36296`).
25+
26+
.. ---------------------------------------------------------------------------
27+
1328
.. _whatsnew_113.regressions:
1429

1530
Fixed regressions
@@ -18,6 +33,7 @@ Fixed regressions
1833
- Fixed regression in :class:`IntegerArray` unary plus and minus operations raising a ``TypeError`` (:issue:`36063`)
1934
- Fixed regression in :meth:`Series.__getitem__` incorrectly raising when the input was a tuple (:issue:`35534`)
2035
- Fixed regression in :meth:`Series.__getitem__` incorrectly raising when the input was a frozenset (:issue:`35747`)
36+
- Fixed regression in :meth:`read_excel` with ``engine="odf"`` caused ``UnboundLocalError`` in some cases where cells had nested child nodes (:issue:`36122`,:issue:`35802`)
2137
-
2238

2339
.. ---------------------------------------------------------------------------
@@ -29,6 +45,8 @@ Bug fixes
2945
- Bug in :func:`read_spss` where passing a ``pathlib.Path`` as ``path`` would raise a ``TypeError`` (:issue:`33666`)
3046
- Bug in :meth:`Series.str.startswith` and :meth:`Series.str.endswith` with ``category`` dtype not propagating ``na`` parameter (:issue:`36241`)
3147
- Bug in :class:`Series` constructor where integer overflow would occur for sufficiently large scalar inputs when an index was provided (:issue:`36291`)
48+
- Bug in :meth:`DataFrame.sort_values` raising an ``AttributeError`` when sorting on a key that casts column to categorical dtype (:issue:`36383`)
49+
- Bug in :meth:`DataFrame.stack` raising a ``ValueError`` when stacking :class:`MultiIndex` columns based on position when the levels had duplicate names (:issue:`36353`)
3250

3351
.. ---------------------------------------------------------------------------
3452

doc/source/whatsnew/v1.2.0.rst

+5-3
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ Other enhancements
118118
- :class:`Index` with object dtype supports division and multiplication (:issue:`34160`)
119119
- :meth:`DataFrame.explode` and :meth:`Series.explode` now support exploding of sets (:issue:`35614`)
120120
- `Styler` now allows direct CSS class name addition to individual data cells (:issue:`36159`)
121+
- :meth:`Rolling.mean()` and :meth:`Rolling.sum()` use Kahan summation to calculate the mean to avoid numerical problems (:issue:`10319`, :issue:`11645`, :issue:`13254`, :issue:`32761`, :issue:`36031`)
122+
- :meth:`DatetimeIndex.searchsorted`, :meth:`TimedeltaIndex.searchsorted`, :meth:`PeriodIndex.searchsorted`, and :meth:`Series.searchsorted` with datetimelike dtypes will now try to cast string arguments (listlike and scalar) to the matching datetimelike type (:issue:`36346`)
121123

122124
.. _whatsnew_120.api_breaking.python:
123125

@@ -209,6 +211,7 @@ Deprecations
209211
- Deprecated parameter ``inplace`` in :meth:`MultiIndex.set_codes` and :meth:`MultiIndex.set_levels` (:issue:`35626`)
210212
- Deprecated parameter ``dtype`` in :~meth:`Index.copy` on method all index classes. Use the :meth:`Index.astype` method instead for changing dtype(:issue:`35853`)
211213
- Date parser functions :func:`~pandas.io.date_converters.parse_date_time`, :func:`~pandas.io.date_converters.parse_date_fields`, :func:`~pandas.io.date_converters.parse_all_fields` and :func:`~pandas.io.date_converters.generic_parser` from ``pandas.io.date_converters`` are deprecated and will be removed in a future version; use :func:`to_datetime` instead (:issue:`35741`)
214+
- :meth:`DataFrame.lookup` is deprecated and will be removed in a future version, use :meth:`DataFrame.melt` and :meth:`DataFrame.loc` instead (:issue:`18682`)
212215

213216
.. ---------------------------------------------------------------------------
214217
@@ -218,7 +221,7 @@ Deprecations
218221
Performance improvements
219222
~~~~~~~~~~~~~~~~~~~~~~~~
220223

221-
- Performance improvements when creating Series with dtype `str` or :class:`StringDtype` from array with many string elements (:issue:`36304`, :issue:`36317`)
224+
- Performance improvements when creating Series with dtype `str` or :class:`StringDtype` from array with many string elements (:issue:`36304`, :issue:`36317`, :issue:`36325`)
222225
- Performance improvement in :meth:`GroupBy.agg` with the ``numba`` engine (:issue:`35759`)
223226
- Performance improvements when creating :meth:`pd.Series.map` from a huge dictionary (:issue:`34717`)
224227
- Performance improvement in :meth:`GroupBy.transform` with the ``numba`` engine (:issue:`36240`)
@@ -313,10 +316,9 @@ I/O
313316
- In :meth:`read_csv` `float_precision='round_trip'` now handles `decimal` and `thousands` parameters (:issue:`35365`)
314317
- :meth:`to_pickle` and :meth:`read_pickle` were closing user-provided file objects (:issue:`35679`)
315318
- :meth:`to_csv` passes compression arguments for `'gzip'` always to `gzip.GzipFile` (:issue:`28103`)
316-
- :meth:`to_csv` did not support zip compression for binary file object not having a filename (:issue: `35058`)
319+
- :meth:`to_csv` did not support zip compression for binary file object not having a filename (:issue:`35058`)
317320
- :meth:`to_csv` and :meth:`read_csv` did not honor `compression` and `encoding` for path-like objects that are internally converted to file-like objects (:issue:`35677`, :issue:`26124`, and :issue:`32392`)
318321
- :meth:`to_picke` and :meth:`read_pickle` did not support compression for file-objects (:issue:`26237`, :issue:`29054`, and :issue:`29570`)
319-
- Bug in :meth:`read_excel` with `engine="odf"` caused ``UnboundLocalError`` in some cases where cells had nested child nodes (:issue:`36122`, and :issue:`35802`)
320322

321323
Plotting
322324
^^^^^^^^

environment.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
- asv
1313

1414
# building
15-
- cython>=0.29.16
15+
- cython>=0.29.21
1616

1717
# code checks
1818
- black=19.10b0
@@ -106,6 +106,7 @@ dependencies:
106106
- cftime # Needed for downstream xarray.CFTimeIndex test
107107
- pyreadstat # pandas.read_spss
108108
- tabulate>=0.8.3 # DataFrame.to_markdown
109+
- natsort # DataFrame.sort_values
109110
- pip:
110111
- git+https://github.com/pandas-dev/pydata-sphinx-theme.git@master
111112
- git+https://github.com/numpy/numpydoc

0 commit comments

Comments
 (0)