Skip to content

Commit 645e01e

Browse files
committed
Merge branch 'master' into PR_TOOL_MERGE_PR_26316
2 parents 4c86f53 + be4b48e commit 645e01e

File tree

397 files changed

+5441
-3063
lines changed

Some content is hidden

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

397 files changed

+5441
-3063
lines changed

asv_bench/benchmarks/ctors.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,14 @@ class SeriesConstructors:
5555
[False, True],
5656
['float', 'int']]
5757

58+
# Generators get exhausted on use, so run setup before every call
59+
number = 1
60+
repeat = (3, 250, 10)
61+
5862
def setup(self, data_fmt, with_index, dtype):
63+
if data_fmt in (gen_of_str, gen_of_tuples) and with_index:
64+
raise NotImplementedError('Series constructors do not support '
65+
'using generators with indexes')
5966
N = 10**4
6067
if dtype == 'float':
6168
arr = np.random.randn(N)

asv_bench/benchmarks/frame_ctor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ class FromRecords:
7272
params = [None, 1000]
7373
param_names = ['nrows']
7474

75+
# Generators get exhausted on use, so run setup before every call
76+
number = 1
77+
repeat = (3, 250, 10)
78+
7579
def setup(self, nrows):
7680
N = 100000
7781
self.gen = ((x, (x * 20), (x * 100)) for x in range(N))

asv_bench/benchmarks/indexing.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pandas import (Series, DataFrame, MultiIndex,
66
Int64Index, UInt64Index, Float64Index,
77
IntervalIndex, CategoricalIndex,
8-
IndexSlice, concat, date_range)
8+
IndexSlice, concat, date_range, option_context)
99

1010

1111
class NumericSeriesIndexing:
@@ -335,4 +335,20 @@ def time_assign_with_setitem(self):
335335
self.df[i] = np.random.randn(self.N)
336336

337337

338+
class ChainIndexing:
339+
340+
params = [None, 'warn']
341+
param_names = ['mode']
342+
343+
def setup(self, mode):
344+
self.N = 1000000
345+
346+
def time_chained_indexing(self, mode):
347+
with warnings.catch_warnings(record=True):
348+
with option_context('mode.chained_assignment', mode):
349+
df = DataFrame({'A': np.arange(self.N), 'B': 'foo'})
350+
df2 = df[df.A > self.N // 2]
351+
df2['C'] = 1.0
352+
353+
338354
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/offset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
pass
1010

1111
hcal = pd.tseries.holiday.USFederalHolidayCalendar()
12-
# These offests currently raise a NotImplimentedError with .apply_index()
12+
# These offsets currently raise a NotImplimentedError with .apply_index()
1313
non_apply = [pd.offsets.Day(),
1414
pd.offsets.BYearEnd(),
1515
pd.offsets.BYearBegin(),

ci/azure/windows.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ jobs:
2121
displayName: 'Add conda to PATH'
2222
- script: conda update -q -n base conda
2323
displayName: Update conda
24-
- script: conda env create -q --file ci\\deps\\azure-windows-$(CONDA_PY).yaml
24+
- script: |
25+
call activate
26+
conda env create -q --file ci\\deps\\azure-windows-$(CONDA_PY).yaml
2527
displayName: 'Create anaconda environment'
2628
- script: |
2729
call activate pandas-dev

ci/code_checks.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ fi
256256
### DOCSTRINGS ###
257257
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
258258

259-
MSG='Validate docstrings (GL03, GL06, GL07, GL09, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA05)' ; echo $MSG
260-
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL03,GL06,GL07,GL09,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA05
259+
MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA05)' ; echo $MSG
260+
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL03,GL04,GL05,GL06,GL07,GL09,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA05
261261
RET=$(($RET + $?)) ; echo $MSG "DONE"
262262

263263
fi

ci/deps/azure-35-compat.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ dependencies:
2222
- hypothesis>=3.58.0
2323
- pytest-xdist
2424
- pytest-mock
25+
- pytest-azurepipelines
2526
- pip
2627
- pip:
2728
# for python 3.5, pytest>=4.0.2 is not available in conda

ci/deps/azure-36-locale.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies:
2323
- pytest>=4.0.2
2424
- pytest-xdist
2525
- pytest-mock
26+
- pytest-azurepipelines
2627
- hypothesis>=3.58.0
2728
- pip
2829
- pip:

ci/deps/azure-36-locale_slow.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ dependencies:
2929
- pytest>=4.0.2
3030
- pytest-xdist
3131
- pytest-mock
32+
- pytest-azurepipelines
3233
- moto
3334
- pip
3435
- pip:

ci/deps/azure-37-locale.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dependencies:
2828
- pytest>=4.0.2
2929
- pytest-xdist
3030
- pytest-mock
31+
- pytest-azurepipelines
3132
- pip
3233
- pip:
3334
- hypothesis>=3.58.0

ci/deps/azure-37-numpydev.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ dependencies:
1717
- "--pre"
1818
- "numpy"
1919
- "scipy"
20+
- pytest-azurepipelines

ci/deps/azure-macos-35.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ dependencies:
2929
- pytest-xdist
3030
- pytest-mock
3131
- hypothesis>=3.58.0
32+
- pytest-azurepipelines

ci/deps/azure-windows-36.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ dependencies:
2626
- pytest>=4.0.2
2727
- pytest-xdist
2828
- pytest-mock
29+
- pytest-azurepipelines
2930
- hypothesis>=3.58.0

ci/deps/azure-windows-37.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dependencies:
2828
- pytest>=4.0.2
2929
- pytest-xdist
3030
- pytest-mock
31+
- pytest-azurepipelines
3132
- moto
3233
- hypothesis>=3.58.0
3334
- pyreadstat

ci/deps/travis-36-locale.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,22 @@ dependencies:
88
- python-blosc
99
- cython>=0.28.2
1010
- fastparquet=0.2.1
11-
- gcsfs=0.1.0
11+
- gcsfs=0.2.2
1212
- html5lib
1313
- ipython
1414
- jinja2
15-
- lxml=3.7.0
16-
- matplotlib=3.0.0
15+
- lxml=3.8.0
16+
- matplotlib=3.0.*
1717
- nomkl
1818
- numexpr
1919
- numpy
2020
- openpyxl
2121
- pandas-gbq=0.8.0
2222
- psycopg2=2.6.2
23-
- pymysql=0.7.9
23+
- pymysql=0.7.11
2424
- pytables
2525
- python-dateutil
26-
# cannot go past python=3.6.6 for matplotlib=3.0.0 due to
27-
# https://github.com/matplotlib/matplotlib/issues/12626
28-
- python=3.6.6
26+
- python=3.6.*
2927
- pytz
3028
- s3fs=0.0.8
3129
- scipy

codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
codecov:
22
branch: master
33

4+
comment: off
5+
46
coverage:
57
status:
68
project:
79
default:
8-
enabled: no
910
target: '82'
1011
patch:
1112
default:
12-
enabled: no
1313
target: '50'

doc/source/development/contributing.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ to build the documentation locally before pushing your changes.
127127

128128
.. _contributing.dev_c:
129129

130-
Installing a C Compiler
130+
Installing a C compiler
131131
~~~~~~~~~~~~~~~~~~~~~~~
132132

133133
Pandas uses C extensions (mostly written using Cython) to speed up certain
@@ -155,7 +155,7 @@ Let us know if you have any difficulties by opening an issue or reaching out on
155155

156156
.. _contributing.dev_python:
157157

158-
Creating a Python Environment
158+
Creating a Python environment
159159
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160160

161161
Now that you have a C compiler, create an isolated pandas development
@@ -209,7 +209,7 @@ See the full conda docs `here <http://conda.pydata.org/docs>`__.
209209

210210
.. _contributing.pip:
211211

212-
Creating a Python Environment (pip)
212+
Creating a Python environment (pip)
213213
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
214214

215215
If you aren't using conda for your development environment, follow these instructions.
@@ -605,7 +605,7 @@ and run ``flake8`` on them, one after the other.
605605

606606
.. _contributing.import-formatting:
607607

608-
Import Formatting
608+
Import formatting
609609
~~~~~~~~~~~~~~~~~
610610
*pandas* uses `isort <https://pypi.org/project/isort/>`__ to standardise import
611611
formatting across the codebase.
@@ -651,7 +651,7 @@ The `--recursive` flag can be passed to sort all files in a directory.
651651

652652
You can then verify the changes look ok, then git :ref:`commit <contributing.commit-code>` and :ref:`push <contributing.push-code>`.
653653

654-
Backwards Compatibility
654+
Backwards compatibility
655655
~~~~~~~~~~~~~~~~~~~~~~~
656656

657657
Please try to maintain backward compatibility. *pandas* has lots of users with lots of
@@ -699,7 +699,7 @@ See :ref:`contributing.warnings` for more.
699699

700700
.. _contributing.ci:
701701

702-
Testing With Continuous Integration
702+
Testing with continuous integration
703703
-----------------------------------
704704

705705
The *pandas* test suite will run automatically on `Travis-CI <https://travis-ci.org/>`__ and
@@ -930,7 +930,7 @@ options or subtle interactions to test (or think of!) all of them.
930930

931931
.. _contributing.warnings:
932932

933-
Testing Warnings
933+
Testing warnings
934934
~~~~~~~~~~~~~~~~
935935

936936
By default, one of pandas CI workers will fail if any unhandled warnings are emitted.

doc/source/development/contributing_docstring.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ plot will be generated automatically when building the documentation.
929929
930930
.. _docstring.sharing:
931931

932-
Sharing Docstrings
932+
Sharing docstrings
933933
------------------
934934

935935
Pandas has a system for sharing docstrings, with slight variations, between

doc/source/development/extending.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{ header }}
44

55
****************
6-
Extending Pandas
6+
Extending pandas
77
****************
88

99
While pandas provides a rich set of methods, containers, and data types, your
@@ -12,7 +12,7 @@ pandas.
1212

1313
.. _extending.register-accessors:
1414

15-
Registering Custom Accessors
15+
Registering custom accessors
1616
----------------------------
1717

1818
Libraries can use the decorators
@@ -70,7 +70,7 @@ applies only to certain dtypes.
7070

7171
.. _extending.extension-types:
7272

73-
Extension Types
73+
Extension types
7474
---------------
7575

7676
.. versionadded:: 0.23.0
@@ -210,7 +210,7 @@ will
210210

211211
.. _extending.extension.testing:
212212

213-
Testing Extension Arrays
213+
Testing extension arrays
214214
^^^^^^^^^^^^^^^^^^^^^^^^
215215

216216
We provide a test suite for ensuring that your extension arrays satisfy the expected
@@ -238,7 +238,7 @@ for a list of all the tests available.
238238

239239
.. _extending.subclassing-pandas:
240240

241-
Subclassing pandas Data Structures
241+
Subclassing pandas data structures
242242
----------------------------------
243243

244244
.. warning:: There are some easier alternatives before considering subclassing ``pandas`` data structures.
@@ -260,7 +260,7 @@ This section describes how to subclass ``pandas`` data structures to meet more s
260260

261261
You can find a nice example in `geopandas <https://github.com/geopandas/geopandas>`_ project.
262262

263-
Override Constructor Properties
263+
Override constructor properties
264264
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
265265

266266
Each data structure has several *constructor properties* for returning a new
@@ -348,7 +348,7 @@ Below example shows how to define ``SubclassedSeries`` and ``SubclassedDataFrame
348348
>>> type(sliced2)
349349
<class '__main__.SubclassedSeries'>
350350
351-
Define Original Properties
351+
Define original properties
352352
^^^^^^^^^^^^^^^^^^^^^^^^^^
353353

354354
To let original data structures have additional properties, you should let ``pandas`` know what properties are added. ``pandas`` maps unknown properties to data names overriding ``__getattribute__``. Defining original properties can be done in one of 2 ways:

doc/source/development/internals.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ So, for example, ``Series[category]._values`` is a ``Categorical``, while
102102

103103
.. _ref-subclassing-pandas:
104104

105-
Subclassing pandas Data Structures
105+
Subclassing pandas data structures
106106
----------------------------------
107107

108108
This section has been moved to :ref:`extending.subclassing-pandas`.

doc/source/ecosystem.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{ header }}
44

55
****************
6-
pandas Ecosystem
6+
Pandas ecosystem
77
****************
88

99
Increasingly, packages are being built on top of pandas to address specific needs
@@ -26,7 +26,7 @@ substantial projects that you feel should be on this list, please let us know.
2626

2727
.. _ecosystem.stats:
2828

29-
Statistics and Machine Learning
29+
Statistics and machine learning
3030
-------------------------------
3131

3232
`Statsmodels <https://www.statsmodels.org/>`__
@@ -243,7 +243,7 @@ you can obtain for free on the FRED website.
243243

244244
.. _ecosystem.domain:
245245

246-
Domain Specific
246+
Domain specific
247247
---------------
248248

249249
`Geopandas <https://github.com/kjordahl/geopandas>`__
@@ -332,7 +332,7 @@ and check that they're *actually* true.
332332

333333
.. _ecosystem.extensions:
334334

335-
Extension Data Types
335+
Extension data types
336336
--------------------
337337

338338
Pandas provides an interface for defining

0 commit comments

Comments
 (0)