Skip to content

Commit 5efe39c

Browse files
authored
Merge branch 'master' into bug-drop-multiindex
2 parents a599970 + 8b7305a commit 5efe39c

File tree

235 files changed

+7065
-6855
lines changed

Some content is hidden

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

235 files changed

+7065
-6855
lines changed

asv_bench/benchmarks/dtypes.py

+22
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from .pandas_vb_common import (
66
datetime_dtypes,
77
extension_dtypes,
8+
lib,
89
numeric_dtypes,
910
string_dtypes,
1011
)
@@ -40,4 +41,25 @@ def time_pandas_dtype_invalid(self, dtype):
4041
pass
4142

4243

44+
class InferDtypes:
45+
param_names = ["dtype"]
46+
data_dict = {
47+
"np-object": np.array([1] * 100000, dtype="O"),
48+
"py-object": [1] * 100000,
49+
"np-null": np.array([1] * 50000 + [np.nan] * 50000),
50+
"py-null": [1] * 50000 + [None] * 50000,
51+
"np-int": np.array([1] * 100000, dtype=int),
52+
"np-floating": np.array([1.0] * 100000, dtype=float),
53+
"empty": [],
54+
"bytes": [b"a"] * 100000,
55+
}
56+
params = list(data_dict.keys())
57+
58+
def time_infer_skipna(self, dtype):
59+
lib.infer_dtype(self.data_dict[dtype], skipna=True)
60+
61+
def time_infer(self, dtype):
62+
lib.infer_dtype(self.data_dict[dtype], skipna=False)
63+
64+
4365
from .pandas_vb_common import setup # noqa: F401 isort:skip

ci/azure/posix.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,13 @@ jobs:
6969
displayName: 'Build versions'
7070

7171
- task: PublishTestResults@2
72+
condition: succeededOrFailed()
7273
inputs:
74+
failTaskOnFailedTests: true
7375
testResultsFiles: 'test-data.xml'
7476
testRunTitle: ${{ format('{0}-$(CONDA_PY)', parameters.name) }}
7577
displayName: 'Publish test results'
7678

77-
- powershell: |
78-
$(Get-Content "test-data.xml" | Out-String) -match 'failures="(.*?)"'
79-
if ($matches[1] -eq 0) {
80-
Write-Host "No test failures in test-data"
81-
} else {
82-
Write-Error "$($matches[1]) tests failed" # will produce $LASTEXITCODE=1
83-
}
84-
displayName: 'Check for test failures'
85-
8679
- script: |
8780
source activate pandas-dev
8881
python ci/print_skipped.py

ci/azure/windows.yml

+12-10
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,34 @@ jobs:
2323
Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
2424
Write-Host "##vso[task.prependpath]$HOME/miniconda3/bin"
2525
displayName: 'Add conda to PATH'
26+
2627
- script: conda update -q -n base conda
2728
displayName: 'Update conda'
29+
2830
- bash: |
2931
conda env create -q --file ci\\deps\\azure-windows-$(CONDA_PY).yaml
3032
displayName: 'Create anaconda environment'
33+
3134
- bash: |
3235
source activate pandas-dev
3336
conda list
34-
ci\\incremental\\build.cmd
37+
python setup.py build_ext -q -i
38+
python -m pip install --no-build-isolation -e .
3539
displayName: 'Build'
40+
3641
- bash: |
3742
source activate pandas-dev
3843
ci/run_tests.sh
3944
displayName: 'Test'
45+
4046
- task: PublishTestResults@2
47+
condition: succeededOrFailed()
4148
inputs:
49+
failTaskOnFailedTests: true
4250
testResultsFiles: 'test-data.xml'
43-
testRunTitle: 'Windows-$(CONDA_PY)'
44-
- powershell: |
45-
$(Get-Content "test-data.xml" | Out-String) -match 'failures="(.*?)"'
46-
if ($matches[1] -eq 0) {
47-
Write-Host "No test failures in test-data"
48-
} else {
49-
Write-Error "$($matches[1]) tests failed" # will produce $LASTEXITCODE=1
50-
}
51-
displayName: 'Check for test failures'
51+
testRunTitle: ${{ format('{0}-$(CONDA_PY)', parameters.name) }}
52+
displayName: 'Publish test results'
53+
5254
- bash: |
5355
source activate pandas-dev
5456
python ci/print_skipped.py

ci/code_checks.sh

+15-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
5252
black --version
5353

5454
MSG='Checking black formatting' ; echo $MSG
55-
black . --check
55+
black . --check
5656
RET=$(($RET + $?)) ; echo $MSG "DONE"
5757

5858
# `setup.cfg` contains the list of error codes that are being ignored in flake8
@@ -104,7 +104,7 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
104104
isort --version-number
105105

106106
# Imports - Check formatting using isort see setup.cfg for settings
107-
MSG='Check import format using isort ' ; echo $MSG
107+
MSG='Check import format using isort' ; echo $MSG
108108
ISORT_CMD="isort --recursive --check-only pandas asv_bench"
109109
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
110110
eval $ISORT_CMD | awk '{print "##[error]" $0}'; RET=$(($RET + ${PIPESTATUS[0]}))
@@ -122,13 +122,18 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
122122
# Check for imports from collections.abc instead of `from collections import abc`
123123
MSG='Check for non-standard imports' ; echo $MSG
124124
invgrep -R --include="*.py*" -E "from pandas.core.common import" pandas
125+
RET=$(($RET + $?)) ; echo $MSG "DONE"
125126
invgrep -R --include="*.py*" -E "from pandas.core import common" pandas
127+
RET=$(($RET + $?)) ; echo $MSG "DONE"
126128
invgrep -R --include="*.py*" -E "from collections.abc import" pandas
129+
RET=$(($RET + $?)) ; echo $MSG "DONE"
127130
invgrep -R --include="*.py*" -E "from numpy import nan" pandas
131+
RET=$(($RET + $?)) ; echo $MSG "DONE"
128132

129133
# Checks for test suite
130134
# Check for imports from pandas.util.testing instead of `import pandas.util.testing as tm`
131135
invgrep -R --include="*.py*" -E "from pandas.util.testing import" pandas/tests
136+
RET=$(($RET + $?)) ; echo $MSG "DONE"
132137
invgrep -R --include="*.py*" -E "from pandas.util import testing as tm" pandas/tests
133138
RET=$(($RET + $?)) ; echo $MSG "DONE"
134139

@@ -195,6 +200,10 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
195200
invgrep -R --include="*.py" --include="*.pyx" -E 'class.*:\n\n( )+"""' .
196201
RET=$(($RET + $?)) ; echo $MSG "DONE"
197202

203+
MSG='Check for use of {foo!r} instead of {repr(foo)}' ; echo $MSG
204+
invgrep -R --include=*.{py,pyx} '!r}' pandas
205+
RET=$(($RET + $?)) ; echo $MSG "DONE"
206+
198207
MSG='Check for use of comment-based annotation syntax' ; echo $MSG
199208
invgrep -R --include="*.py" -P '# type: (?!ignore)' pandas
200209
RET=$(($RET + $?)) ; echo $MSG "DONE"
@@ -203,6 +212,10 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
203212
invgrep -R --include=*.{py,pyx} '\.__class__' pandas
204213
RET=$(($RET + $?)) ; echo $MSG "DONE"
205214

215+
MSG='Check for use of xrange instead of range' ; echo $MSG
216+
invgrep -R --include=*.{py,pyx} 'xrange' pandas
217+
RET=$(($RET + $?)) ; echo $MSG "DONE"
218+
206219
MSG='Check that no file in the repo contains trailing whitespaces' ; echo $MSG
207220
INVGREP_APPEND=" <- trailing whitespaces found"
208221
invgrep -RI --exclude=\*.{svg,c,cpp,html,js} --exclude-dir=env "\s$" *

ci/incremental/build.cmd

-9
This file was deleted.

ci/run_tests.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ sh -c "$PYTEST_CMD"
3838

3939
if [[ "$COVERAGE" && $? == 0 && "$TRAVIS_BRANCH" == "master" ]]; then
4040
echo "uploading coverage"
41-
echo "bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME"
42-
bash <(curl -s https://codecov.io/bash) -Z -c -F $TYPE -f $COVERAGE_FNAME
41+
echo "bash <(curl -s https://codecov.io/bash) -Z -c -f $COVERAGE_FNAME"
42+
bash <(curl -s https://codecov.io/bash) -Z -c -f $COVERAGE_FNAME
4343
fi

doc/source/_static/favicon.ico

-3.81 KB
Binary file not shown.

doc/source/conf.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,11 @@
204204
# Theme options are theme-specific and customize the look and feel of a theme
205205
# further. For a list of options available for each theme, see the
206206
# documentation.
207-
# html_theme_options = {}
207+
html_theme_options = {
208+
"external_links": [],
209+
"github_url": "https://github.com/pandas-dev/pandas",
210+
"twitter_url": "https://twitter.com/pandas_dev",
211+
}
208212

209213
# Add any paths that contain custom themes here, relative to this directory.
210214
# html_theme_path = ["themes"]
@@ -228,7 +232,7 @@
228232
# The name of an image file (within the static path) to use as favicon of the
229233
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
230234
# pixels large.
231-
html_favicon = os.path.join(html_static_path[0], "favicon.ico")
235+
html_favicon = "../../web/pandas/static/img/favicon.ico"
232236

233237
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
234238
# using the given strftime format.

doc/source/whatsnew/v1.0.0.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
569569
- A tuple passed to :meth:`DataFrame.groupby` is now exclusively treated as a single key (:issue:`18314`)
570570
- Removed the previously deprecated :meth:`Index.contains`, use ``key in index`` instead (:issue:`30103`)
571571
- Addition and subtraction of ``int`` or integer-arrays is no longer allowed in :class:`Timestamp`, :class:`DatetimeIndex`, :class:`TimedeltaIndex`, use ``obj + n * obj.freq`` instead of ``obj + n`` (:issue:`22535`)
572+
- Removed :meth:`Series.ptp` (:issue:`21614`)
572573
- Removed :meth:`Series.from_array` (:issue:`18258`)
573574
- Removed :meth:`DataFrame.from_items` (:issue:`18458`)
574575
- Removed :meth:`DataFrame.as_matrix`, :meth:`Series.as_matrix` (:issue:`18458`)
@@ -667,6 +668,7 @@ Performance improvements
667668
- Performance improvement when checking if values in a :class:`Categorical` are equal, equal or larger or larger than a given scalar.
668669
The improvement is not present if checking if the :class:`Categorical` is less than or less than or equal than the scalar (:issue:`29820`)
669670
- Performance improvement in :meth:`Index.equals` and :meth:`MultiIndex.equals` (:issue:`29134`)
671+
- Performance improvement in :func:`~pandas.api.types.infer_dtype` when ``skipna`` is ``True`` (:issue:`28814`)
670672

671673
.. _whatsnew_1000.bug_fixes:
672674

@@ -712,7 +714,10 @@ Datetimelike
712714
- Bug in :func:`pandas.to_datetime` when called with ``None`` raising ``TypeError`` instead of returning ``NaT`` (:issue:`30011`)
713715
- Bug in :func:`pandas.to_datetime` failing for `deques` when using ``cache=True`` (the default) (:issue:`29403`)
714716
- Bug in :meth:`Series.item` with ``datetime64`` or ``timedelta64`` dtype, :meth:`DatetimeIndex.item`, and :meth:`TimedeltaIndex.item` returning an integer instead of a :class:`Timestamp` or :class:`Timedelta` (:issue:`30175`)
715-
-
717+
- Bug in :class:`DatetimeIndex` addition when adding a non-optimized :class:`DateOffset` incorrectly dropping timezone information (:issue:`30336`)
718+
- Bug in :meth:`DataFrame.drop` where attempting to drop non-existent values from a DatetimeIndex would yield a confusing error message (:issue:`30399`)
719+
- Bug in :meth:`DataFrame.append` would remove the timezone-awareness of new data (:issue:`30238`)
720+
716721

717722
Timedelta
718723
^^^^^^^^^

environment.yml

+19-10
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ dependencies:
3333
- nbconvert>=5.4.1
3434
- nbsphinx
3535
- pandoc
36-
# Dask and its dependencies
36+
37+
# Dask and its dependencies (that dont install with dask)
3738
- dask-core
3839
- toolz>=0.7.3
3940
- fsspec>=0.5.1
@@ -54,6 +55,8 @@ dependencies:
5455
- pytest>=5.0.1
5556
- pytest-cov
5657
- pytest-xdist>=1.21
58+
59+
# downstream tests
5760
- seaborn
5861
- statsmodels
5962

@@ -74,22 +77,28 @@ dependencies:
7477
- scipy>=1.1
7578

7679
# optional for io
77-
- beautifulsoup4>=4.6.0 # pandas.read_html
80+
# ---------------
81+
# pd.read_html
82+
- beautifulsoup4>=4.6.0
83+
- html5lib
84+
- lxml
85+
86+
# pd.read_excel, DataFrame.to_excel, pd.ExcelWriter, pd.ExcelFile
87+
- openpyxl<=3.0.1
88+
- xlrd
89+
- xlsxwriter
90+
- xlwt
91+
- odfpy
92+
7893
- fastparquet>=0.3.2 # pandas.read_parquet, DataFrame.to_parquet
79-
- html5lib # pandas.read_html
80-
- lxml # pandas.read_html
81-
- openpyxl<=3.0.1 # pandas.read_excel, DataFrame.to_excel, pandas.ExcelWriter, pandas.ExcelFile
8294
- pyarrow>=0.13.1 # pandas.read_parquet, DataFrame.to_parquet, pandas.read_feather, DataFrame.to_feather
95+
- python-snappy # required by pyarrow
96+
8397
- pyqt>=5.9.2 # pandas.read_clipboard
8498
- pytables>=3.4.2 # pandas.read_hdf, DataFrame.to_hdf
85-
- python-snappy # required by pyarrow
8699
- s3fs # pandas.read_csv... when using 's3://...' path
87100
- sqlalchemy # pandas.read_sql, DataFrame.to_sql
88101
- xarray # DataFrame.to_xarray
89-
- xlrd # pandas.read_excel, DataFrame.to_excel, pandas.ExcelWriter, pandas.ExcelFile
90-
- xlsxwriter # pandas.read_excel, DataFrame.to_excel, pandas.ExcelWriter, pandas.ExcelFile
91-
- xlwt # pandas.read_excel, DataFrame.to_excel, pandas.ExcelWriter, pandas.ExcelFile
92-
- odfpy # pandas.read_excel
93102
- pyreadstat # pandas.read_spss
94103
- pip:
95104
- git+https://github.com/pandas-dev/pandas-sphinx-theme.git@master

0 commit comments

Comments
 (0)