Skip to content

Commit d7363a7

Browse files
Merge branch 'master' into issue_backupbackup
2 parents 5420f25 + e9de5f3 commit d7363a7

File tree

111 files changed

+2514
-1322
lines changed

Some content is hidden

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

111 files changed

+2514
-1322
lines changed

asv_bench/benchmarks/groupby.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
method_blacklist = {
1515
'object': {'median', 'prod', 'sem', 'cumsum', 'sum', 'cummin', 'mean',
1616
'max', 'skew', 'cumprod', 'cummax', 'rank', 'pct_change', 'min',
17-
'var', 'mad', 'describe', 'std'},
17+
'var', 'mad', 'describe', 'std', 'quantile'},
1818
'datetime': {'median', 'prod', 'sem', 'cumsum', 'sum', 'mean', 'skew',
1919
'cumprod', 'cummax', 'pct_change', 'var', 'mad', 'describe',
2020
'std'}
@@ -316,8 +316,9 @@ class GroupByMethods(object):
316316
['all', 'any', 'bfill', 'count', 'cumcount', 'cummax', 'cummin',
317317
'cumprod', 'cumsum', 'describe', 'ffill', 'first', 'head',
318318
'last', 'mad', 'max', 'min', 'median', 'mean', 'nunique',
319-
'pct_change', 'prod', 'rank', 'sem', 'shift', 'size', 'skew',
320-
'std', 'sum', 'tail', 'unique', 'value_counts', 'var'],
319+
'pct_change', 'prod', 'quantile', 'rank', 'sem', 'shift',
320+
'size', 'skew', 'std', 'sum', 'tail', 'unique', 'value_counts',
321+
'var'],
321322
['direct', 'transformation']]
322323

323324
def setup(self, dtype, method, application):

asv_bench/benchmarks/series_methods.py

+19
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,25 @@ def time_dropna(self, dtype):
124124
self.s.dropna()
125125

126126

127+
class SearchSorted(object):
128+
129+
goal_time = 0.2
130+
params = ['int8', 'int16', 'int32', 'int64',
131+
'uint8', 'uint16', 'uint32', 'uint64',
132+
'float16', 'float32', 'float64',
133+
'str']
134+
param_names = ['dtype']
135+
136+
def setup(self, dtype):
137+
N = 10**5
138+
data = np.array([1] * N + [2] * N + [3] * N).astype(dtype)
139+
self.s = Series(data)
140+
141+
def time_searchsorted(self, dtype):
142+
key = '2' if dtype == 'str' else 2
143+
self.s.searchsorted(key)
144+
145+
127146
class Map(object):
128147

129148
params = ['dict', 'Series']

ci/deps/azure-27-compat.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ dependencies:
1818
- xlsxwriter=0.5.2
1919
- xlwt=0.7.5
2020
# universal
21-
- pytest
21+
- pytest>=4.0.2
2222
- pytest-xdist
2323
- pytest-mock
24+
- isort
2425
- pip:
2526
- html5lib==1.0b2
2627
- beautifulsoup4==4.2.1

ci/deps/azure-27-locale.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ dependencies:
2020
- xlsxwriter=0.5.2
2121
- xlwt=0.7.5
2222
# universal
23-
- pytest
23+
- pytest>=4.0.2
2424
- pytest-xdist
2525
- pytest-mock
2626
- hypothesis>=3.58.0
27+
- isort
2728
- pip:
2829
- html5lib==1.0b2
2930
- beautifulsoup4==4.2.1

ci/deps/azure-36-locale_slow.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ dependencies:
2626
- xlsxwriter
2727
- xlwt
2828
# universal
29-
- pytest
29+
- pytest>=4.0.2
3030
- pytest-xdist
3131
- pytest-mock
3232
- moto
33+
- isort
3334
- pip:
3435
- hypothesis>=3.58.0

ci/deps/azure-37-locale.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ dependencies:
2525
- xlsxwriter
2626
- xlwt
2727
# universal
28-
- pytest
28+
- pytest>=4.0.2
2929
- pytest-xdist
3030
- pytest-mock
31+
- isort
3132
- pip:
3233
- hypothesis>=3.58.0
3334
- moto # latest moto in conda-forge fails with 3.7, move to conda dependencies when this is fixed

ci/deps/azure-37-numpydev.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ dependencies:
66
- pytz
77
- Cython>=0.28.2
88
# universal
9-
- pytest
9+
- pytest>=4.0.2
1010
- pytest-xdist
1111
- pytest-mock
1212
- hypothesis>=3.58.0
13+
- isort
1314
- pip:
1415
- "git+git://github.com/dateutil/dateutil.git"
1516
- "-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"

ci/deps/azure-macos-35.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ dependencies:
2121
- xlrd
2222
- xlsxwriter
2323
- xlwt
24-
# universal
25-
- pytest
26-
- pytest-xdist
27-
- pytest-mock
24+
- isort
2825
- pip:
2926
- python-dateutil==2.5.3
27+
# universal
28+
- pytest>=4.0.2
29+
- pytest-xdist
30+
- pytest-mock
3031
- hypothesis>=3.58.0

ci/deps/azure-windows-27.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ dependencies:
2525
- xlwt
2626
# universal
2727
- cython>=0.28.2
28-
- pytest
28+
- pytest>=4.0.2
2929
- pytest-xdist
3030
- pytest-mock
3131
- moto
3232
- hypothesis>=3.58.0
33+
- isort

ci/deps/azure-windows-36.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ dependencies:
2323
- xlwt
2424
# universal
2525
- cython>=0.28.2
26-
- pytest
26+
- pytest>=4.0.2
2727
- pytest-xdist
2828
- pytest-mock
2929
- hypothesis>=3.58.0
30+
- isort

ci/deps/travis-27.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ dependencies:
3939
- xlsxwriter=0.5.2
4040
- xlwt=0.7.5
4141
# universal
42-
- pytest
42+
- pytest>=4.0.2
4343
- pytest-xdist
4444
- pytest-mock
4545
- moto==1.3.4
4646
- hypothesis>=3.58.0
47+
- isort
4748
- pip:
4849
- backports.lzma
4950
- pandas-gbq

ci/deps/travis-36-doc.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ dependencies:
4141
- xlsxwriter
4242
- xlwt
4343
# universal
44-
- pytest
44+
- pytest>=4.0.2
4545
- pytest-xdist
46+
- isort

ci/deps/travis-36-locale.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ dependencies:
2828
- xlsxwriter
2929
- xlwt
3030
# universal
31-
- pytest
31+
- pytest>=4.0.2
3232
- pytest-xdist
3333
- pytest-mock
3434
- moto
35+
- isort
3536
- pip:
3637
- hypothesis>=3.58.0

ci/deps/travis-36-slow.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ dependencies:
2525
- xlsxwriter
2626
- xlwt
2727
# universal
28-
- pytest
28+
- pytest>=4.0.2
2929
- pytest-xdist
3030
- pytest-mock
3131
- moto
3232
- hypothesis>=3.58.0
33+
- isort

ci/deps/travis-36.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ dependencies:
3333
- xlsxwriter
3434
- xlwt
3535
# universal
36-
- pytest
36+
- pytest>=4.0.2
3737
- pytest-xdist
3838
- pytest-cov
3939
- pytest-mock
4040
- hypothesis>=3.58.0
41+
- isort
4142
- pip:
4243
- brotlipy
4344
- coverage

ci/deps/travis-37.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ dependencies:
1212
- nomkl
1313
- pyarrow
1414
- pytz
15-
- pytest
15+
- pytest>=4.0.2
1616
- pytest-xdist
1717
- pytest-mock
1818
- hypothesis>=3.58.0
1919
- s3fs
20+
- isort
2021
- pip:
2122
- moto

doc/source/development/contributing.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ reducing the turn-around time for checking your changes.
435435

436436
# compile the reference docs for a single function
437437
python make.py clean
438-
python make.py --single DataFrame.join
438+
python make.py --single pandas.DataFrame.join
439439

440440
For comparison, a full documentation build may take 15 minutes, but a single
441441
section may take 15 seconds. Subsequent builds, which only process portions
@@ -731,7 +731,7 @@ extensions in `numpy.testing
731731

732732
.. note::
733733

734-
The earliest supported pytest version is 3.6.0.
734+
The earliest supported pytest version is 4.0.2.
735735

736736
Writing tests
737737
~~~~~~~~~~~~~

doc/source/development/extending.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ decorate a class, providing the name of attribute to add. The class's
3333
3434
@staticmethod
3535
def _validate(obj):
36-
if 'lat' not in obj.columns or 'lon' not in obj.columns:
37-
raise AttributeError("Must have 'lat' and 'lon'.")
36+
# verify there is a column latitude and a column longitude
37+
if 'latitude' not in obj.columns or 'longitude' not in obj.columns:
38+
raise AttributeError("Must have 'latitude' and 'longitude'.")
3839
3940
@property
4041
def center(self):

doc/source/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ pandas is equipped with an exhaustive set of unit tests, covering about 97% of
202202
the code base as of this writing. To run it on your machine to verify that
203203
everything is working (and that you have all of the dependencies, soft and hard,
204204
installed), make sure you have `pytest
205-
<http://docs.pytest.org/en/latest/>`__ >= 3.6 and `Hypothesis
205+
<http://docs.pytest.org/en/latest/>`__ >= 4.0.2 and `Hypothesis
206206
<https://hypothesis.readthedocs.io/>`__ >= 3.58, then run:
207207

208208
::

doc/source/reference/groupby.rst

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ application to columns of a specific data type.
9999
DataFrameGroupBy.idxmax
100100
DataFrameGroupBy.idxmin
101101
DataFrameGroupBy.mad
102+
DataFrameGroupBy.nunique
102103
DataFrameGroupBy.pct_change
103104
DataFrameGroupBy.plot
104105
DataFrameGroupBy.quantile

doc/source/styled.xlsx

5.55 KB
Binary file not shown.

doc/source/user_guide/missing_data.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ examined :ref:`in the API <api.dataframe.missing>`.
335335
Interpolation
336336
~~~~~~~~~~~~~
337337

338-
.. versionadded:: 0.21.0
338+
.. versionadded:: 0.23.0
339339

340340
The ``limit_area`` keyword argument was added.
341341

doc/source/user_guide/timeseries.rst

+10
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,16 @@ We are stopping on the included end-point as it is part of the index:
633633
dft2 = dft2.swaplevel(0, 1).sort_index()
634634
dft2.loc[idx[:, '2013-01-05'], :]
635635
636+
.. versionadded:: 0.25.0
637+
638+
Slicing with string indexing also honors UTC offset.
639+
640+
.. ipython:: python
641+
642+
df = pd.DataFrame([0], index=pd.DatetimeIndex(['2019-01-01'], tz='US/Pacific'))
643+
df
644+
df['2019-01-01 12:00:00+04:00':'2019-01-01 13:00:00+04:00']
645+
636646
.. _timeseries.slice_vs_exact_match:
637647

638648
Slice vs. Exact Match

doc/source/whatsnew/v0.24.2.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ Fixed Regressions
2323
- Fixed regression in :meth:`DataFrame.all` and :meth:`DataFrame.any` where ``bool_only=True`` was ignored (:issue:`25101`)
2424
- Fixed issue in ``DataFrame`` construction with passing a mixed list of mixed types could segfault. (:issue:`25075`)
2525
- Fixed regression in :meth:`DataFrame.apply` causing ``RecursionError`` when ``dict``-like classes were passed as argument. (:issue:`25196`)
26+
- Fixed regression in :meth:`DataFrame.replace` where ``regex=True`` was only replacing patterns matching the start of the string (:issue:`25259`)
2627

2728
- Fixed regression in :meth:`DataFrame.duplicated()`, where empty dataframe was not returning a boolean dtyped Series. (:issue:`25184`)
2829
- Fixed regression in :meth:`Series.min` and :meth:`Series.max` where ``numeric_only=True`` was ignored when the ``Series`` contained ```Categorical`` data (:issue:`25299`)
30+
- Fixed regression in subtraction between :class:`Series` objects with ``datetime64[ns]`` dtype incorrectly raising ``OverflowError`` when the `Series` on the right contains null values (:issue:`25317`)
31+
- Fixed regression in :class:`TimedeltaIndex` where `np.sum(index)` incorrectly returned a zero-dimensional object instead of a scalar (:issue:`25282`)
32+
- Fixed regression in ``IntervalDtype`` construction where passing an incorrect string with 'Interval' as a prefix could result in a ``RecursionError``. (:issue:`25338`)
2933

3034
.. _whatsnew_0242.enhancements:
3135

@@ -93,7 +97,7 @@ Bug Fixes
9397
**Other**
9498

9599
- Bug in :meth:`Series.is_unique` where single occurrences of ``NaN`` were not considered unique (:issue:`25180`)
96-
-
100+
- Bug in :func:`merge` when merging an empty ``DataFrame`` with an ``Int64`` column or a non-empty ``DataFrame`` with an ``Int64`` column that is all ``NaN`` (:issue:`25183`)
97101
-
98102

99103
.. _whatsnew_0.242.contributors:

0 commit comments

Comments
 (0)