Skip to content

Commit 675c5d6

Browse files
committed
Merge branch 'master' of https://github.com/pandas-dev/pandas into iss24919_df_iloc_support_zero_dim_np_array
2 parents 760a3a3 + 4a20d5b commit 675c5d6

File tree

221 files changed

+6142
-9092
lines changed

Some content is hidden

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

221 files changed

+6142
-9092
lines changed

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ doc:
2323
cd doc; \
2424
python make.py clean; \
2525
python make.py html
26-
python make.py spellcheck

asv_bench/benchmarks/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Pandas benchmarks."""

asv_bench/benchmarks/io/hdf.py

+1-28
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import warnings
2-
31
import numpy as np
4-
from pandas import DataFrame, Panel, date_range, HDFStore, read_hdf
2+
from pandas import DataFrame, date_range, HDFStore, read_hdf
53
import pandas.util.testing as tm
64

75
from ..pandas_vb_common import BaseIO
@@ -99,31 +97,6 @@ def time_store_info(self):
9997
self.store.info()
10098

10199

102-
class HDFStorePanel(BaseIO):
103-
104-
def setup(self):
105-
self.fname = '__test__.h5'
106-
with warnings.catch_warnings(record=True):
107-
self.p = Panel(np.random.randn(20, 1000, 25),
108-
items=['Item%03d' % i for i in range(20)],
109-
major_axis=date_range('1/1/2000', periods=1000),
110-
minor_axis=['E%03d' % i for i in range(25)])
111-
self.store = HDFStore(self.fname)
112-
self.store.append('p1', self.p)
113-
114-
def teardown(self):
115-
self.store.close()
116-
self.remove(self.fname)
117-
118-
def time_read_store_table_panel(self):
119-
with warnings.catch_warnings(record=True):
120-
self.store.select('p1')
121-
122-
def time_write_store_table_panel(self):
123-
with warnings.catch_warnings(record=True):
124-
self.store.append('p2', self.p)
125-
126-
127100
class HDF(BaseIO):
128101

129102
params = ['table', 'fixed']

ci/code_checks.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
9393
# this particular codebase (e.g. src/headers, src/klib, src/msgpack). However,
9494
# we can lint all header files since they aren't "generated" like C files are.
9595
MSG='Linting .c and .h' ; echo $MSG
96-
cpplint --quiet --extensions=c,h --headers=h --recursive --filter=-readability/casting,-runtime/int,-build/include_subdir pandas/_libs/src/*.h pandas/_libs/src/parser pandas/_libs/ujson pandas/_libs/tslibs/src/datetime
96+
cpplint --quiet --extensions=c,h --headers=h --recursive --filter=-readability/casting,-runtime/int,-build/include_subdir pandas/_libs/src/*.h pandas/_libs/src/parser pandas/_libs/ujson pandas/_libs/tslibs/src/datetime pandas/io/msgpack pandas/_libs/*.cpp pandas/util
9797
RET=$(($RET + $?)) ; echo $MSG "DONE"
9898

9999
echo "isort --version-number"
@@ -174,9 +174,10 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
174174
MSG='Check that no file in the repo contains tailing whitespaces' ; echo $MSG
175175
set -o pipefail
176176
if [[ "$AZURE" == "true" ]]; then
177-
! grep -n --exclude="*.svg" -RI "\s$" * | awk -F ":" '{print "##vso[task.logissue type=error;sourcepath=" $1 ";linenumber=" $2 ";] Tailing whitespaces found: " $3}'
177+
# we exclude all c/cpp files as the c/cpp files of pandas code base are tested when Linting .c and .h files
178+
! grep -n '--exclude=*.'{svg,c,cpp,html} -RI "\s$" * | awk -F ":" '{print "##vso[task.logissue type=error;sourcepath=" $1 ";linenumber=" $2 ";] Tailing whitespaces found: " $3}'
178179
else
179-
! grep -n --exclude="*.svg" -RI "\s$" * | awk -F ":" '{print $1 ":" $2 ":Tailing whitespaces found: " $3}'
180+
! grep -n '--exclude=*.'{svg,c,cpp,html} -RI "\s$" * | awk -F ":" '{print $1 ":" $2 ":Tailing whitespaces found: " $3}'
180181
fi
181182
RET=$(($RET + $?)) ; echo $MSG "DONE"
182183
fi
@@ -206,7 +207,7 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then
206207

207208
MSG='Doctests frame.py' ; echo $MSG
208209
pytest -q --doctest-modules pandas/core/frame.py \
209-
-k"-axes -combine -itertuples -join -pivot_table -query -reindex -reindex_axis -round"
210+
-k" -itertuples -join -reindex -reindex_axis -round"
210211
RET=$(($RET + $?)) ; echo $MSG "DONE"
211212

212213
MSG='Doctests series.py' ; echo $MSG
@@ -240,8 +241,8 @@ fi
240241
### DOCSTRINGS ###
241242
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
242243

243-
MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, EX04)' ; echo $MSG
244-
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR05,EX04
244+
MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, PR10, EX04, RT04, RT05, SS05, SA05)' ; echo $MSG
245+
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR04,PR05,EX04,RT04,RT05,SS05,SA05
245246
RET=$(($RET + $?)) ; echo $MSG "DONE"
246247

247248
fi

ci/deps/azure-27-compat.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies:
2020
# universal
2121
- pytest
2222
- pytest-xdist
23+
- pytest-mock
2324
- pip:
2425
- html5lib==1.0b2
2526
- beautifulsoup4==4.2.1

ci/deps/azure-27-locale.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ dependencies:
2222
# universal
2323
- pytest
2424
- pytest-xdist
25+
- pytest-mock
2526
- hypothesis>=3.58.0
2627
- pip:
2728
- html5lib==1.0b2

ci/deps/azure-36-locale_slow.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dependencies:
2828
# universal
2929
- pytest
3030
- pytest-xdist
31+
- pytest-mock
3132
- moto
3233
- pip:
3334
- hypothesis>=3.58.0

ci/deps/azure-37-locale.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ dependencies:
2727
# universal
2828
- pytest
2929
- pytest-xdist
30+
- pytest-mock
3031
- pip:
3132
- hypothesis>=3.58.0
3233
- moto # latest moto in conda-forge fails with 3.7, move to conda dependencies when this is fixed

ci/deps/azure-37-numpydev.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dependencies:
88
# universal
99
- pytest
1010
- pytest-xdist
11+
- pytest-mock
1112
- hypothesis>=3.58.0
1213
- pip:
1314
- "git+git://github.com/dateutil/dateutil.git"

ci/deps/azure-macos-35.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependencies:
2424
# universal
2525
- pytest
2626
- pytest-xdist
27+
- pytest-mock
2728
- pip:
2829
- python-dateutil==2.5.3
2930
- hypothesis>=3.58.0

ci/deps/azure-windows-27.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ dependencies:
2727
- cython>=0.28.2
2828
- pytest
2929
- pytest-xdist
30+
- pytest-mock
3031
- moto
3132
- hypothesis>=3.58.0

ci/deps/azure-windows-36.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ dependencies:
2525
- cython>=0.28.2
2626
- pytest
2727
- pytest-xdist
28+
- pytest-mock
2829
- hypothesis>=3.58.0

ci/deps/travis-27.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dependencies:
4141
# universal
4242
- pytest
4343
- pytest-xdist
44+
- pytest-mock
4445
- moto==1.3.4
4546
- hypothesis>=3.58.0
4647
- pip:

ci/deps/travis-36-locale.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ dependencies:
3030
# universal
3131
- pytest
3232
- pytest-xdist
33+
- pytest-mock
3334
- moto
3435
- pip:
3536
- hypothesis>=3.58.0

ci/deps/travis-36-slow.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ dependencies:
2727
# universal
2828
- pytest
2929
- pytest-xdist
30+
- pytest-mock
3031
- moto
3132
- hypothesis>=3.58.0

ci/deps/travis-36.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dependencies:
3636
- pytest
3737
- pytest-xdist
3838
- pytest-cov
39+
- pytest-mock
3940
- hypothesis>=3.58.0
4041
- pip:
4142
- brotlipy

ci/deps/travis-37.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dependencies:
1414
- pytz
1515
- pytest
1616
- pytest-xdist
17+
- pytest-mock
1718
- hypothesis>=3.58.0
1819
- s3fs
1920
- pip:

doc/cheatsheet/Pandas_Cheat_Sheet.pdf

6.61 KB
Binary file not shown.
13 Bytes
Binary file not shown.
209 KB
Binary file not shown.
5.93 KB
Binary file not shown.

doc/source/reference/arrays.rst

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Methods
120120
Timestamp.timetuple
121121
Timestamp.timetz
122122
Timestamp.to_datetime64
123+
Timestamp.to_numpy
123124
Timestamp.to_julian_date
124125
Timestamp.to_period
125126
Timestamp.to_pydatetime
@@ -191,6 +192,7 @@ Methods
191192
Timedelta.round
192193
Timedelta.to_pytimedelta
193194
Timedelta.to_timedelta64
195+
Timedelta.to_numpy
194196
Timedelta.total_seconds
195197

196198
A collection of timedeltas may be stored in a :class:`TimedeltaArray`.

doc/source/user_guide/groupby.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ arbitrary function, for example:
13171317
df.groupby(['Store', 'Product']).pipe(mean)
13181318
13191319
where ``mean`` takes a GroupBy object and finds the mean of the Revenue and Quantity
1320-
columns repectively for each Store-Product combination. The ``mean`` function can
1320+
columns respectively for each Store-Product combination. The ``mean`` function can
13211321
be any function that takes in a GroupBy object; the ``.pipe`` will pass the GroupBy
13221322
object as a parameter into the function you specify.
13231323

0 commit comments

Comments
 (0)