Skip to content

Commit f83d9f3

Browse files
resolve merge conflicts
2 parents 7f9158e + f08a1e6 commit f83d9f3

File tree

180 files changed

+4210
-10545
lines changed

Some content is hidden

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

180 files changed

+4210
-10545
lines changed

.pre-commit-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ repos:
1515
hooks:
1616
- id: isort
1717
language: python_venv
18+
exclude: ^pandas/__init__\.py$|^pandas/core/api\.py$

MANIFEST.in

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ graft pandas
1515
global-exclude *.bz2
1616
global-exclude *.csv
1717
global-exclude *.dta
18+
global-exclude *.feather
1819
global-exclude *.gz
1920
global-exclude *.h5
2021
global-exclude *.html
@@ -24,7 +25,10 @@ global-exclude *.pickle
2425
global-exclude *.png
2526
global-exclude *.pyc
2627
global-exclude *.pyd
28+
global-exclude *.ods
29+
global-exclude *.odt
2730
global-exclude *.sas7bdat
31+
global-exclude *.sav
2832
global-exclude *.so
2933
global-exclude *.xls
3034
global-exclude *.xlsm

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Most development discussion is taking place on github in this repo. Further, the
225225

226226
All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome.
227227

228-
A detailed overview on how to contribute can be found in the **[contributing guide](https://dev.pandas.io/contributing.html)**. There is also an [overview](.github/CONTRIBUTING.md) on GitHub.
228+
A detailed overview on how to contribute can be found in the **[contributing guide](https://dev.pandas.io/docs/contributing.html)**. There is also an [overview](.github/CONTRIBUTING.md) on GitHub.
229229

230230
If you are simply looking to start working with the pandas codebase, navigate to the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) and start looking through interesting issues. There are a number of issues listed under [Docs](https://github.com/pandas-dev/pandas/issues?labels=Docs&sort=updated&state=open) and [good first issue](https://github.com/pandas-dev/pandas/issues?labels=good+first+issue&sort=updated&state=open) where you could start out.
231231

asv_bench/benchmarks/frame_methods.py

+11
Original file line numberDiff line numberDiff line change
@@ -609,4 +609,15 @@ def time_dataframe_describe(self):
609609
self.df.describe()
610610

611611

612+
class SelectDtypes:
613+
params = [100, 1000]
614+
param_names = ["n"]
615+
616+
def setup(self, n):
617+
self.df = DataFrame(np.random.randn(10, n))
618+
619+
def time_select_dtypes(self, n):
620+
self.df.select_dtypes(include="int")
621+
622+
612623
from .pandas_vb_common import setup # noqa: F401 isort:skip

azure-pipelines.yml

+17-6
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
displayName: 'Running benchmarks'
105105
condition: true
106106
107-
- job: 'Docs'
107+
- job: 'Web_and_Docs'
108108
pool:
109109
vmImage: ubuntu-16.04
110110
timeoutInMinutes: 90
@@ -119,6 +119,11 @@ jobs:
119119
ci/setup_env.sh
120120
displayName: 'Setup environment and build pandas'
121121
122+
- script: |
123+
source activate pandas-dev
124+
python web/pandas_web.py web/pandas --target-path=web/build
125+
displayName: 'Build website'
126+
122127
- script: |
123128
source activate pandas-dev
124129
# Next we should simply have `doc/make.py --warnings-are-errors`, everything else is required because the ipython directive doesn't fail the build on errors (https://github.com/ipython/ipython/issues/11547)
@@ -128,15 +133,21 @@ jobs:
128133
displayName: 'Build documentation'
129134
130135
- script: |
131-
cd doc/build/html
136+
mkdir -p to_deploy/docs
137+
cp -r web/build/* to_deploy/
138+
cp -r doc/build/html/* to_deploy/docs/
139+
displayName: 'Merge website and docs'
140+
141+
- script: |
142+
cd to_deploy
132143
git init
133144
touch .nojekyll
134145
echo "dev.pandas.io" > CNAME
135146
printf "User-agent: *\nDisallow: /" > robots.txt
136147
git add --all .
137148
git config user.email "[email protected]"
138-
git config user.name "pandas-docs-bot"
139-
git commit -m "pandas documentation in master"
149+
git config user.name "pandas-bot"
150+
git commit -m "pandas web and documentation in master"
140151
displayName: 'Create git repo for docs build'
141152
condition : |
142153
and(not(eq(variables['Build.Reason'], 'PullRequest')),
@@ -160,10 +171,10 @@ jobs:
160171
eq(variables['Build.SourceBranch'], 'refs/heads/master'))
161172
162173
- script: |
163-
cd doc/build/html
174+
cd to_deploy
164175
git remote add origin [email protected]:pandas-dev/pandas-dev.github.io.git
165176
git push -f origin master
166-
displayName: 'Publish docs to GitHub pages'
177+
displayName: 'Publish web and docs to GitHub pages'
167178
condition : |
168179
and(not(eq(variables['Build.Reason'], 'PullRequest')),
169180
eq(variables['Build.SourceBranch'], 'refs/heads/master'))

ci/azure/posix.yml

+7
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,21 @@ jobs:
4949
echo "Creating Environment"
5050
ci/setup_env.sh
5151
displayName: 'Setup environment and build pandas'
52+
5253
- script: |
5354
source activate pandas-dev
5455
ci/run_tests.sh
5556
displayName: 'Test'
57+
5658
- script: source activate pandas-dev && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
59+
displayName: 'Build versions'
60+
5761
- task: PublishTestResults@2
5862
inputs:
5963
testResultsFiles: 'test-data-*.xml'
6064
testRunTitle: ${{ format('{0}-$(CONDA_PY)', parameters.name) }}
65+
displayName: 'Publish test results'
66+
6167
- powershell: |
6268
$junitXml = "test-data-single.xml"
6369
$(Get-Content $junitXml | Out-String) -match 'failures="(.*?)"'
@@ -83,6 +89,7 @@ jobs:
8389
Write-Error "$($matches[1]) tests failed"
8490
}
8591
displayName: 'Check for test failures'
92+
8693
- script: |
8794
source activate pandas-dev
8895
python ci/print_skipped.py

ci/code_checks.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
188188
set -o pipefail
189189
if [[ "$AZURE" == "true" ]]; then
190190
# we exclude all c/cpp files as the c/cpp files of pandas code base are tested when Linting .c and .h files
191-
! grep -n '--exclude=*.'{svg,c,cpp,html} --exclude-dir=env -RI "\s$" * | awk -F ":" '{print "##vso[task.logissue type=error;sourcepath=" $1 ";linenumber=" $2 ";] Tailing whitespaces found: " $3}'
191+
! grep -n '--exclude=*.'{svg,c,cpp,html,js} --exclude-dir=env -RI "\s$" * | awk -F ":" '{print "##vso[task.logissue type=error;sourcepath=" $1 ";linenumber=" $2 ";] Tailing whitespaces found: " $3}'
192192
else
193-
! grep -n '--exclude=*.'{svg,c,cpp,html} --exclude-dir=env -RI "\s$" * | awk -F ":" '{print $1 ":" $2 ":Tailing whitespaces found: " $3}'
193+
! grep -n '--exclude=*.'{svg,c,cpp,html,js} --exclude-dir=env -RI "\s$" * | awk -F ":" '{print $1 ":" $2 ":Tailing whitespaces found: " $3}'
194194
fi
195195
RET=$(($RET + $?)) ; echo $MSG "DONE"
196196
fi

ci/print_skipped.py

+23-35
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,40 @@
11
#!/usr/bin/env python
2-
3-
import math
42
import os
5-
import sys
63
import xml.etree.ElementTree as et
74

85

9-
def parse_results(filename):
6+
def main(filename):
7+
if not os.path.isfile(filename):
8+
return
9+
1010
tree = et.parse(filename)
1111
root = tree.getroot()
12-
skipped = []
13-
1412
current_class = ""
15-
i = 1
16-
assert i - 1 == len(skipped)
1713
for el in root.findall("testcase"):
1814
cn = el.attrib["classname"]
1915
for sk in el.findall("skipped"):
2016
old_class = current_class
2117
current_class = cn
22-
name = "{classname}.{name}".format(
23-
classname=current_class, name=el.attrib["name"]
24-
)
25-
msg = sk.attrib["message"]
26-
out = ""
2718
if old_class != current_class:
28-
ndigits = int(math.log(i, 10) + 1)
29-
30-
# 4 for : + space + # + space
31-
out += "-" * (len(name + msg) + 4 + ndigits) + "\n"
32-
out += "#{i} {name}: {msg}".format(i=i, name=name, msg=msg)
33-
skipped.append(out)
34-
i += 1
35-
assert i - 1 == len(skipped)
36-
assert i - 1 == len(skipped)
37-
# assert len(skipped) == int(root.attrib['skip'])
38-
return "\n".join(skipped)
39-
40-
41-
def main():
42-
test_files = ["test-data-single.xml", "test-data-multiple.xml", "test-data.xml"]
43-
44-
print("SKIPPED TESTS:")
45-
for fn in test_files:
46-
if os.path.isfile(fn):
47-
print(parse_results(fn))
48-
return 0
19+
yield None
20+
yield {
21+
"class_name": current_class,
22+
"test_name": el.attrib["name"],
23+
"message": sk.attrib["message"],
24+
}
4925

5026

5127
if __name__ == "__main__":
52-
sys.exit(main())
28+
print("SKIPPED TESTS:")
29+
i = 1
30+
for file_type in ("-single", "-multiple", ""):
31+
for test_data in main("test-data{}.xml".format(file_type)):
32+
if test_data is None:
33+
print("-" * 80)
34+
else:
35+
print(
36+
"#{i} {class_name}.{test_name}: {message}".format(
37+
**dict(test_data, i=i)
38+
)
39+
)
40+
i += 1

ci/run_tests.sh

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

3-
set -e
4-
5-
if [ "$DOC" ]; then
6-
echo "We are not running pytest as this is a doc-build"
7-
exit 0
8-
fi
9-
10-
# Workaround for pytest-xdist flaky collection order
3+
# Workaround for pytest-xdist (it collects different tests in the workers if PYTHONHASHSEED is not set)
114
# https://github.com/pytest-dev/pytest/issues/920
125
# https://github.com/pytest-dev/pytest/issues/1075
136
export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))')
@@ -16,7 +9,7 @@ if [ -n "$LOCALE_OVERRIDE" ]; then
169
export LC_ALL="$LOCALE_OVERRIDE"
1710
export LANG="$LOCALE_OVERRIDE"
1811
PANDAS_LOCALE=`python -c 'import pandas; pandas.get_option("display.encoding")'`
19-
if [[ "$LOCALE_OVERIDE" != "$PANDAS_LOCALE" ]]; then
12+
if [[ "$LOCALE_OVERRIDE" != "$PANDAS_LOCALE" ]]; then
2013
echo "pandas could not detect the locale. System locale: $LOCALE_OVERRIDE, pandas detected: $PANDAS_LOCALE"
2114
# TODO Not really aborting the tests until https://github.com/pandas-dev/pandas/issues/23923 is fixed
2215
# exit 1

doc/redirects.csv

-2
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,6 @@ generated/pandas.DataFrame.to_parquet,../reference/api/pandas.DataFrame.to_parqu
503503
generated/pandas.DataFrame.to_period,../reference/api/pandas.DataFrame.to_period
504504
generated/pandas.DataFrame.to_pickle,../reference/api/pandas.DataFrame.to_pickle
505505
generated/pandas.DataFrame.to_records,../reference/api/pandas.DataFrame.to_records
506-
generated/pandas.DataFrame.to_sparse,../reference/api/pandas.DataFrame.to_sparse
507506
generated/pandas.DataFrame.to_sql,../reference/api/pandas.DataFrame.to_sql
508507
generated/pandas.DataFrame.to_stata,../reference/api/pandas.DataFrame.to_stata
509508
generated/pandas.DataFrame.to_string,../reference/api/pandas.DataFrame.to_string
@@ -1432,7 +1431,6 @@ generated/pandas.Series.to_msgpack,../reference/api/pandas.Series.to_msgpack
14321431
generated/pandas.Series.to_numpy,../reference/api/pandas.Series.to_numpy
14331432
generated/pandas.Series.to_period,../reference/api/pandas.Series.to_period
14341433
generated/pandas.Series.to_pickle,../reference/api/pandas.Series.to_pickle
1435-
generated/pandas.Series.to_sparse,../reference/api/pandas.Series.to_sparse
14361434
generated/pandas.Series.to_sql,../reference/api/pandas.Series.to_sql
14371435
generated/pandas.Series.to_string,../reference/api/pandas.Series.to_string
14381436
generated/pandas.Series.to_timestamp,../reference/api/pandas.Series.to_timestamp

doc/source/development/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ Development
1616
internals
1717
extending
1818
developer
19+
policies
1920
roadmap

doc/source/development/policies.rst

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
.. _develop.policies:
2+
3+
********
4+
Policies
5+
********
6+
7+
.. _policies.version:
8+
9+
Version Policy
10+
~~~~~~~~~~~~~~
11+
12+
.. versionchanged:: 1.0.0
13+
14+
Pandas uses a loose variant of semantic versioning (`SemVer`_) to govern
15+
deprecations, API compatibility, and version numbering.
16+
17+
A pandas release number is made up of ``MAJOR.MINOR.PATCH``.
18+
19+
API breaking changes should only occur in **major** releases. Theses changes
20+
will be documented, with clear guidance on what is changing, why it's changing,
21+
and how to migrate existing code to the new behavior.
22+
23+
Whenever possible, a deprecation path will be provided rather than an outright
24+
breaking change.
25+
26+
Pandas will introduce deprecations in **minor** releases. These deprecations
27+
will preserve the existing behavior while emitting a warning that provide
28+
guidance on:
29+
30+
* How to achieve similar behavior if an alternative is available
31+
* The pandas version in which the deprecation will be enforced.
32+
33+
We will not introduce new deprecations in patch releases.
34+
35+
Deprecations will only be enforced in **major** releases. For example, if a
36+
behavior is deprecated in pandas 1.2.0, it will continue to work, with a
37+
warning, for all releases in the 1.x series. The behavior will change and the
38+
deprecation removed in the next next major release (2.0.0).
39+
40+
.. note::
41+
42+
Pandas will sometimes make *behavior changing* bug fixes, as part of
43+
minor or patch releases. Whether or not a change is a bug fix or an
44+
API-breaking change is a judgement call. We'll do our best, and we
45+
invite you to participate in development discussion on the issue
46+
tracker or mailing list.
47+
48+
These policies do not apply to features marked as **experimental** in the documentation.
49+
Pandas may change the behavior of experimental features at any time.
50+
51+
Python Support
52+
~~~~~~~~~~~~~~
53+
54+
Pandas will only drop support for specific Python versions (e.g. 3.5.x, 3.6.x) in
55+
pandas **major** releases.
56+
57+
.. _SemVer: https://semver.org

doc/source/reference/frame.rst

-8
Original file line numberDiff line numberDiff line change
@@ -356,15 +356,7 @@ Serialization / IO / conversion
356356
DataFrame.to_msgpack
357357
DataFrame.to_gbq
358358
DataFrame.to_records
359-
DataFrame.to_sparse
360359
DataFrame.to_dense
361360
DataFrame.to_string
362361
DataFrame.to_clipboard
363362
DataFrame.style
364-
365-
Sparse
366-
~~~~~~
367-
.. autosummary::
368-
:toctree: api/
369-
370-
SparseDataFrame.to_coo

doc/source/reference/series.rst

-11
Original file line numberDiff line numberDiff line change
@@ -576,18 +576,7 @@ Serialization / IO / conversion
576576
Series.to_sql
577577
Series.to_msgpack
578578
Series.to_json
579-
Series.to_sparse
580579
Series.to_dense
581580
Series.to_string
582581
Series.to_clipboard
583582
Series.to_latex
584-
585-
586-
Sparse
587-
------
588-
589-
.. autosummary::
590-
:toctree: api/
591-
592-
SparseSeries.to_coo
593-
SparseSeries.from_coo

doc/source/user_guide/io.rst

+9-1
Original file line numberDiff line numberDiff line change
@@ -4641,6 +4641,14 @@ Several caveats.
46414641

46424642
See the `Full Documentation <https://github.com/wesm/feather>`__.
46434643

4644+
.. ipython:: python
4645+
:suppress:
4646+
4647+
import warnings
4648+
# This can be removed once building with pyarrow >=0.15.0
4649+
warnings.filterwarnings("ignore", "The Sparse", FutureWarning)
4650+
4651+
46444652
.. ipython:: python
46454653
46464654
df = pd.DataFrame({'a': list('abc'),
@@ -4845,7 +4853,7 @@ The above example creates a partitioned dataset that may look like:
48454853
from shutil import rmtree
48464854
try:
48474855
rmtree('test')
4848-
except Exception:
4856+
except OSError:
48494857
pass
48504858
48514859
.. _io.sql:

0 commit comments

Comments
 (0)