Skip to content

Commit 131a8c1

Browse files
committed
BUG: Fix merge master. #33200
2 parents b0c309b + afe7f1d commit 131a8c1

File tree

400 files changed

+10868
-6789
lines changed

Some content is hidden

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

400 files changed

+10868
-6789
lines changed

.travis.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ matrix:
2727
fast_finish: true
2828

2929
include:
30+
# In allowed failures
31+
- dist: bionic
32+
python: 3.9-dev
33+
env:
34+
- JOB="3.9-dev" PATTERN="(not slow and not network and not clipboard)"
3035
- env:
3136
- JOB="3.8" ENV_FILE="ci/deps/travis-38.yaml" PATTERN="(not slow and not network and not clipboard)"
3237

@@ -53,6 +58,11 @@ matrix:
5358
services:
5459
- mysql
5560
- postgresql
61+
allow_failures:
62+
- dist: bionic
63+
python: 3.9-dev
64+
env:
65+
- JOB="3.9-dev" PATTERN="(not slow and not network)"
5666

5767
before_install:
5868
- echo "before_install"
@@ -83,7 +93,7 @@ install:
8393
script:
8494
- echo "script start"
8595
- echo "$JOB"
86-
- source activate pandas-dev
96+
- if [ "$JOB" != "3.9-dev" ]; then source activate pandas-dev; fi
8797
- ci/run_tests.sh
8898

8999
after_script:

asv_bench/benchmarks/algorithms.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,16 @@ class Factorize:
3434
params = [
3535
[True, False],
3636
[True, False],
37-
["int", "uint", "float", "string", "datetime64[ns]", "datetime64[ns, tz]"],
37+
[
38+
"int",
39+
"uint",
40+
"float",
41+
"string",
42+
"datetime64[ns]",
43+
"datetime64[ns, tz]",
44+
"Int64",
45+
"boolean",
46+
],
3847
]
3948
param_names = ["unique", "sort", "dtype"]
4049

@@ -49,13 +58,15 @@ def setup(self, unique, sort, dtype):
4958
"datetime64[ns, tz]": pd.date_range(
5059
"2011-01-01", freq="H", periods=N, tz="Asia/Tokyo"
5160
),
61+
"Int64": pd.array(np.arange(N), dtype="Int64"),
62+
"boolean": pd.array(np.random.randint(0, 2, N), dtype="boolean"),
5263
}[dtype]
5364
if not unique:
5465
data = data.repeat(5)
55-
self.idx = data
66+
self.data = data
5667

5768
def time_factorize(self, unique, sort, dtype):
58-
self.idx.factorize(sort=sort)
69+
pd.factorize(self.data, sort=sort)
5970

6071

6172
class Duplicated:

asv_bench/benchmarks/io/parsers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
try:
44
from pandas._libs.tslibs.parsing import (
5-
_concat_date_cols,
5+
concat_date_cols,
66
_does_string_look_like_datetime,
77
)
88
except ImportError:
@@ -39,4 +39,4 @@ def setup(self, value, dim):
3939
)
4040

4141
def time_check_concat(self, value, dim):
42-
_concat_date_cols(self.object)
42+
concat_date_cols(self.object)

asv_bench/benchmarks/rolling.py

+12-13
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,18 @@ def time_quantile(self, constructor, window, dtype, percentile, interpolation):
150150
self.roll.quantile(percentile, interpolation=interpolation)
151151

152152

153-
class PeakMemFixed:
154-
def setup(self):
155-
N = 10
156-
arr = 100 * np.random.random(N)
157-
self.roll = pd.Series(arr).rolling(10)
158-
159-
def peakmem_fixed(self):
160-
# GH 25926
161-
# This is to detect memory leaks in rolling operations.
162-
# To save time this is only ran on one method.
163-
# 6000 iterations is enough for most types of leaks to be detected
164-
for x in range(6000):
165-
self.roll.max()
153+
class PeakMemFixedWindowMinMax:
154+
155+
params = ["min", "max"]
156+
157+
def setup(self, operation):
158+
N = int(1e6)
159+
arr = np.random.random(N)
160+
self.roll = pd.Series(arr).rolling(2)
161+
162+
def peakmem_fixed(self, operation):
163+
for x in range(5):
164+
getattr(self.roll, operation)()
166165

167166

168167
class ForwardWindowMethods:

ci/build39.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash -e
2+
# Special build for python3.9 until numpy puts its own wheels up
3+
4+
sudo apt-get install build-essential gcc xvfb
5+
pip install --no-deps -U pip wheel setuptools
6+
pip install python-dateutil pytz pytest pytest-xdist hypothesis
7+
pip install cython --pre # https://github.com/cython/cython/issues/3395
8+
9+
git clone https://github.com/numpy/numpy
10+
cd numpy
11+
python setup.py build_ext --inplace
12+
python setup.py install
13+
cd ..
14+
rm -rf numpy
15+
16+
python setup.py build_ext -inplace
17+
python -m pip install --no-build-isolation -e .
18+
19+
python -c "import sys; print(sys.version_info)"
20+
python -c "import pandas as pd"
21+
python -c "import hypothesis"

ci/code_checks.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ fi
353353
### DOCSTRINGS ###
354354
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
355355

356-
MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA02, SA03, SA05)' ; echo $MSG
357-
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA02,SA03,SA05
356+
MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG
357+
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA02,SA03
358358
RET=$(($RET + $?)) ; echo $MSG "DONE"
359359

360360
MSG='Validate correct capitalization among titles in documentation' ; echo $MSG

ci/deps/azure-36-minimum_versions.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: pandas-dev
22
channels:
3-
- defaults
43
- conda-forge
54
dependencies:
65
- python=3.6.1
@@ -19,12 +18,12 @@ dependencies:
1918
- jinja2=2.8
2019
- numba=0.46.0
2120
- numexpr=2.6.2
22-
- numpy=1.13.3
21+
- numpy=1.15.4
2322
- openpyxl=2.5.7
2423
- pytables=3.4.3
2524
- python-dateutil=2.7.3
2625
- pytz=2017.2
27-
- scipy=0.19.0
26+
- scipy=1.2
2827
- xlrd=1.1.0
2928
- xlsxwriter=0.9.8
3029
- xlwt=1.2.0

ci/deps/azure-37-numpydev.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ dependencies:
1414
- pytz
1515
- pip
1616
- pip:
17-
- cython==0.29.16
18-
# GH#33507 cython 3.0a1 is causing TypeErrors 2020-04-13
17+
- cython==0.29.16 # GH#34014
1918
- "git+git://github.com/dateutil/dateutil.git"
2019
- "-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
2120
- "--pre"

ci/deps/azure-macos-36.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- matplotlib=2.2.3
2020
- nomkl
2121
- numexpr
22-
- numpy=1.14
22+
- numpy=1.15.4
2323
- openpyxl
2424
- pyarrow>=0.13.0
2525
- pytables

ci/setup_env.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash -e
22

3+
if [ "$JOB" == "3.9-dev" ]; then
4+
/bin/bash ci/build39.sh
5+
exit 0
6+
fi
7+
38
# edit the locale file if needed
49
if [[ "$(uname)" == "Linux" && -n "$LC_ALL" ]]; then
510
echo "Adding locale to the first line of pandas/__init__.py"
@@ -128,7 +133,7 @@ conda list pandas
128133
echo "[Build extensions]"
129134
python setup.py build_ext -q -i -j2
130135

131-
# XXX: Some of our environments end up with old versions of pip (10.x)
136+
# TODO: Some of our environments end up with old versions of pip (10.x)
132137
# Adding a new enough version of pip to the requirements explodes the
133138
# solve time. Just using pip to update itself.
134139
# - py35_macos

conda.recipe/meta.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ requirements:
2020
- cython
2121
- numpy
2222
- setuptools >=3.3
23-
- python-dateutil >=2.5.0
23+
- python-dateutil >=2.7.3
2424
- pytz
2525
run:
2626
- python {{ python }}
2727
- {{ pin_compatible('numpy') }}
28-
- python-dateutil >=2.5.0
28+
- python-dateutil >=2.7.3
2929
- pytz
3030

3131
test:

doc/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@
410410
intersphinx_mapping = {
411411
"dateutil": ("https://dateutil.readthedocs.io/en/latest/", None),
412412
"matplotlib": ("https://matplotlib.org/", None),
413-
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
413+
"numpy": ("https://numpy.org/doc/stable/", None),
414414
"pandas-gbq": ("https://pandas-gbq.readthedocs.io/en/latest/", None),
415415
"py": ("https://pylib.readthedocs.io/en/latest/", None),
416416
"python": ("https://docs.python.org/3/", None),

doc/source/development/contributing.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ version control to allow many people to work together on the project.
110110
Some great resources for learning Git:
111111

112112
* the `GitHub help pages <https://help.github.com/>`_.
113-
* the `NumPy's documentation <https://docs.scipy.org/doc/numpy/dev/index.html>`_.
113+
* the `NumPy's documentation <https://numpy.org/doc/stable/dev/index.html>`_.
114114
* Matthew Brett's `Pydagogue <https://matthew-brett.github.com/pydagogue/>`_.
115115

116116
Getting started with Git
@@ -581,7 +581,7 @@ do not make sudden changes to the code that could have the potential to break
581581
a lot of user code as a result, that is, we need it to be as *backwards compatible*
582582
as possible to avoid mass breakages.
583583

584-
Additional standards are outlined on the `pandas code style guide <code_style>`_
584+
Additional standards are outlined on the :ref:`pandas code style guide <code_style>`
585585

586586
Optional dependencies
587587
---------------------
@@ -974,7 +974,7 @@ it is worth getting in the habit of writing tests ahead of time so this is never
974974
Like many packages, pandas uses `pytest
975975
<https://docs.pytest.org/en/latest/>`_ and the convenient
976976
extensions in `numpy.testing
977-
<https://docs.scipy.org/doc/numpy/reference/routines.testing.html>`_.
977+
<https://numpy.org/doc/stable/reference/routines.testing.html>`_.
978978

979979
.. note::
980980

doc/source/development/extending.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ and re-boxes it if necessary.
219219

220220
If applicable, we highly recommend that you implement ``__array_ufunc__`` in your
221221
extension array to avoid coercion to an ndarray. See
222-
`the numpy documentation <https://docs.scipy.org/doc/numpy/reference/generated/numpy.lib.mixins.NDArrayOperatorsMixin.html>`__
222+
`the numpy documentation <https://numpy.org/doc/stable/reference/generated/numpy.lib.mixins.NDArrayOperatorsMixin.html>`__
223223
for an example.
224224

225225
As part of your implementation, we require that you defer to pandas when a pandas

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Dependencies
220220
Package Minimum supported version
221221
================================================================ ==========================
222222
`setuptools <https://setuptools.readthedocs.io/en/latest/>`__ 24.2.0
223-
`NumPy <https://www.numpy.org>`__ 1.13.3
223+
`NumPy <https://www.numpy.org>`__ 1.15.4
224224
`python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ 2.7.3
225225
`pytz <https://pypi.org/project/pytz/>`__ 2017.2
226226
================================================================ ==========================

doc/source/getting_started/intro_tutorials/02_read_write.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div class="card-body">
2424
<p class="card-text">
2525

26-
This tutorial uses the titanic data set, stored as CSV. The data
26+
This tutorial uses the Titanic data set, stored as CSV. The data
2727
consists of the following data columns:
2828

2929
- PassengerId: Id of every passenger.
@@ -61,7 +61,7 @@ How do I read and write tabular data?
6161
<ul class="task-bullet">
6262
<li>
6363

64-
I want to analyse the titanic passenger data, available as a CSV file.
64+
I want to analyze the Titanic passenger data, available as a CSV file.
6565

6666
.. ipython:: python
6767
@@ -134,7 +134,7 @@ strings (``object``).
134134
<ul class="task-bullet">
135135
<li>
136136

137-
My colleague requested the titanic data as a spreadsheet.
137+
My colleague requested the Titanic data as a spreadsheet.
138138

139139
.. ipython:: python
140140

doc/source/getting_started/intro_tutorials/03_subset_data.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ When using the column names, row labels or a condition expression, use
330330
the ``loc`` operator in front of the selection brackets ``[]``. For both
331331
the part before and after the comma, you can use a single label, a list
332332
of labels, a slice of labels, a conditional expression or a colon. Using
333-
a colon specificies you want to select all rows or columns.
333+
a colon specifies you want to select all rows or columns.
334334

335335
.. raw:: html
336336

doc/source/getting_started/intro_tutorials/06_calculate_statistics.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div class="card-body">
2424
<p class="card-text">
2525

26-
This tutorial uses the titanic data set, stored as CSV. The data
26+
This tutorial uses the Titanic data set, stored as CSV. The data
2727
consists of the following data columns:
2828

2929
- PassengerId: Id of every passenger.
@@ -72,7 +72,7 @@ Aggregating statistics
7272
<ul class="task-bullet">
7373
<li>
7474

75-
What is the average age of the titanic passengers?
75+
What is the average age of the Titanic passengers?
7676

7777
.. ipython:: python
7878
@@ -95,7 +95,7 @@ across rows by default.
9595
<ul class="task-bullet">
9696
<li>
9797

98-
What is the median age and ticket fare price of the titanic passengers?
98+
What is the median age and ticket fare price of the Titanic passengers?
9999

100100
.. ipython:: python
101101
@@ -148,7 +148,7 @@ Aggregating statistics grouped by category
148148
<ul class="task-bullet">
149149
<li>
150150

151-
What is the average age for male versus female titanic passengers?
151+
What is the average age for male versus female Titanic passengers?
152152

153153
.. ipython:: python
154154

0 commit comments

Comments
 (0)