Skip to content

Commit 6b9aef6

Browse files
authored
Merge branch 'master' into update-groupby
2 parents 6a01c73 + b1eb97b commit 6b9aef6

File tree

574 files changed

+22613
-22111
lines changed

Some content is hidden

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

574 files changed

+22613
-22111
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ dist
5757
# wheel files
5858
*.whl
5959
**/wheelhouse/*
60+
pip-wheel-metadata
6061
# coverage
6162
.coverage
6263
coverage.xml

.pre-commit-config.yaml

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
repos:
2-
- repo: https://github.com/python/black
3-
rev: stable
4-
hooks:
5-
- id: black
6-
language_version: python3.7
7-
- repo: https://gitlab.com/pycqa/flake8
8-
rev: 3.7.7
9-
hooks:
10-
- id: flake8
11-
language: python_venv
12-
additional_dependencies: [flake8-comprehensions]
13-
- repo: https://github.com/pre-commit/mirrors-isort
14-
rev: v4.3.20
15-
hooks:
16-
- id: isort
17-
language: python_venv
2+
- repo: https://github.com/python/black
3+
rev: stable
4+
hooks:
5+
- id: black
6+
language_version: python3.7
7+
- repo: https://gitlab.com/pycqa/flake8
8+
rev: 3.7.7
9+
hooks:
10+
- id: flake8
11+
language: python_venv
12+
additional_dependencies: [flake8-comprehensions]
13+
- repo: https://github.com/pre-commit/mirrors-isort
14+
rev: v4.3.20
15+
hooks:
16+
- id: isort
17+
language: python_venv
18+
exclude: ^pandas/__init__\.py$|^pandas/core/api\.py$

.travis.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ matrix:
3030
- python: 3.5
3131

3232
include:
33+
- dist: bionic
34+
# 18.04
35+
python: 3.8-dev
36+
env:
37+
- JOB="3.8-dev" PATTERN="(not slow and not network)"
38+
3339
- dist: trusty
3440
env:
3541
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" PATTERN="(not slow and not network)"
@@ -71,24 +77,27 @@ before_install:
7177
# This overrides travis and tells it to look nowhere.
7278
- export BOTO_CONFIG=/dev/null
7379

80+
7481
install:
7582
- echo "install start"
7683
- ci/prep_cython_cache.sh
7784
- ci/setup_env.sh
7885
- ci/submit_cython_cache.sh
7986
- echo "install done"
8087

88+
8189
before_script:
8290
# display server (for clipboard functionality) needs to be started here,
8391
# does not work if done in install:setup_env.sh (GH-26103)
8492
- export DISPLAY=":99.0"
8593
- echo "sh -e /etc/init.d/xvfb start"
86-
- sh -e /etc/init.d/xvfb start
94+
- if [ "$JOB" != "3.8-dev" ]; then sh -e /etc/init.d/xvfb start; fi
8795
- sleep 3
8896

8997
script:
9098
- echo "script start"
91-
- source activate pandas-dev
99+
- echo "$JOB"
100+
- if [ "$JOB" != "3.8-dev" ]; then source activate pandas-dev; fi
92101
- ci/run_tests.sh
93102

94103
after_script:

MANIFEST.in

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include LICENSE
33
include RELEASE.md
44
include README.md
55
include setup.py
6+
include pyproject.toml
67

78
graft doc
89
prune doc/build
@@ -14,6 +15,7 @@ graft pandas
1415
global-exclude *.bz2
1516
global-exclude *.csv
1617
global-exclude *.dta
18+
global-exclude *.feather
1719
global-exclude *.gz
1820
global-exclude *.h5
1921
global-exclude *.html
@@ -23,7 +25,10 @@ global-exclude *.pickle
2325
global-exclude *.png
2426
global-exclude *.pyc
2527
global-exclude *.pyd
28+
global-exclude *.ods
29+
global-exclude *.odt
2630
global-exclude *.sas7bdat
31+
global-exclude *.sav
2732
global-exclude *.so
2833
global-exclude *.xls
2934
global-exclude *.xlsm

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ black:
1818
black . --exclude '(asv_bench/env|\.egg|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist|setup.py)'
1919

2020
develop: build
21-
python setup.py develop
21+
python -m pip install --no-build-isolation -e .
2222

2323
doc:
2424
-rm -rf doc/build doc/source/generated

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,17 @@ python setup.py install
188188

189189
or for installing in [development mode](https://pip.pypa.io/en/latest/reference/pip_install.html#editable-installs):
190190

191+
191192
```sh
192-
python setup.py develop
193+
python -m pip install --no-build-isolation -e .
193194
```
194195

195-
Alternatively, you can use `pip` if you want all the dependencies pulled
196-
in automatically (the `-e` option is for installing it in [development
197-
mode](https://pip.pypa.io/en/latest/reference/pip_install.html#editable-installs)):
196+
If you have `make`, you can also use `make develop` to run the same command.
197+
198+
or alternatively
198199

199200
```sh
200-
pip install -e .
201+
python setup.py develop
201202
```
202203

203204
See the full instructions for [installing from source](https://pandas.pydata.org/pandas-docs/stable/install.html#installing-from-source).
@@ -224,7 +225,7 @@ Most development discussion is taking place on github in this repo. Further, the
224225

225226
All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome.
226227

227-
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.
228229

229230
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.
230231

asv_bench/asv.conf.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@
5050
"xlsxwriter": [],
5151
"xlrd": [],
5252
"xlwt": [],
53+
"odfpy": [],
5354
"pytest": [],
5455
// If using Windows with python 2.7 and want to build using the
5556
// mingw toolchain (rather than MSVC), uncomment the following line.
5657
// "libpython": [],
5758
},
58-
59+
"conda_channels": ["defaults", "conda-forge"],
5960
// Combinations of libraries/python versions can be excluded/included
6061
// from the set to test. Each entry is a dictionary containing additional
6162
// key-value pairs to include/exclude.

asv_bench/benchmarks/attrs_caching.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import numpy as np
2+
23
from pandas import DataFrame
34

45
try:
@@ -32,4 +33,4 @@ def time_cache_readonly(self):
3233
self.obj.prop
3334

3435

35-
from .pandas_vb_common import setup # noqa: F401
36+
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/binary_ops.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import numpy as np
2+
23
from pandas import DataFrame, Series, date_range
34
from pandas.core.algorithms import checked_add_with_arr
45

@@ -155,4 +156,4 @@ def time_add_overflow_both_arg_nan(self):
155156
)
156157

157158

158-
from .pandas_vb_common import setup # noqa: F401
159+
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/categoricals.py

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import warnings
2+
13
import numpy as np
4+
25
import pandas as pd
36
import pandas.util.testing as tm
4-
import warnings
57

68
try:
79
from pandas.api.types import union_categoricals
@@ -280,4 +282,18 @@ def time_sort_values(self):
280282
self.index.sort_values(ascending=False)
281283

282284

283-
from .pandas_vb_common import setup # noqa: F401
285+
class SearchSorted:
286+
def setup(self):
287+
N = 10 ** 5
288+
self.ci = tm.makeCategoricalIndex(N).sort_values()
289+
self.c = self.ci.values
290+
self.key = self.ci.categories[1]
291+
292+
def time_categorical_index_contains(self):
293+
self.ci.searchsorted(self.key)
294+
295+
def time_categorical_contains(self):
296+
self.c.searchsorted(self.key)
297+
298+
299+
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/ctors.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import numpy as np
2+
3+
from pandas import DatetimeIndex, Index, MultiIndex, Series, Timestamp
24
import pandas.util.testing as tm
3-
from pandas import Series, Index, DatetimeIndex, Timestamp, MultiIndex
45

56

67
def no_change(arr):
@@ -66,7 +67,7 @@ class SeriesConstructors:
6667
def setup(self, data_fmt, with_index, dtype):
6768
if data_fmt in (gen_of_str, gen_of_tuples) and with_index:
6869
raise NotImplementedError(
69-
"Series constructors do not support " "using generators with indexes"
70+
"Series constructors do not support using generators with indexes"
7071
)
7172
N = 10 ** 4
7273
if dtype == "float":
@@ -113,4 +114,4 @@ def time_multiindex_from_iterables(self):
113114
MultiIndex.from_product(self.iterables)
114115

115116

116-
from .pandas_vb_common import setup # noqa: F401
117+
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/dtypes.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1+
import numpy as np
2+
13
from pandas.api.types import pandas_dtype
24

3-
import numpy as np
45
from .pandas_vb_common import (
5-
numeric_dtypes,
66
datetime_dtypes,
7-
string_dtypes,
87
extension_dtypes,
8+
numeric_dtypes,
9+
string_dtypes,
910
)
1011

11-
1212
_numpy_dtypes = [
1313
np.dtype(dtype) for dtype in (numeric_dtypes + datetime_dtypes + string_dtypes)
1414
]
@@ -40,4 +40,4 @@ def time_pandas_dtype_invalid(self, dtype):
4040
pass
4141

4242

43-
from .pandas_vb_common import setup # noqa: F401
43+
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/eval.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import numpy as np
2+
23
import pandas as pd
34

45
try:
@@ -26,7 +27,7 @@ def time_add(self, engine, threads):
2627

2728
def time_and(self, engine, threads):
2829
pd.eval(
29-
"(self.df > 0) & (self.df2 > 0) & " "(self.df3 > 0) & (self.df4 > 0)",
30+
"(self.df > 0) & (self.df2 > 0) & (self.df3 > 0) & (self.df4 > 0)",
3031
engine=engine,
3132
)
3233

@@ -62,4 +63,4 @@ def time_query_with_boolean_selection(self):
6263
self.df.query("(a >= @self.min_val) & (a <= @self.max_val)")
6364

6465

65-
from .pandas_vb_common import setup # noqa: F401
66+
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/frame_ctor.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import numpy as np
2+
3+
from pandas import DataFrame, MultiIndex, Series, Timestamp, date_range
24
import pandas.util.testing as tm
3-
from pandas import DataFrame, Series, MultiIndex, Timestamp, date_range
45

56
try:
67
from pandas.tseries.offsets import Nano, Hour
@@ -104,4 +105,4 @@ def time_frame_from_lists(self):
104105
self.df = DataFrame(self.data)
105106

106107

107-
from .pandas_vb_common import setup # noqa: F401
108+
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/frame_methods.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import warnings
21
import string
2+
import warnings
33

44
import numpy as np
55

@@ -609,4 +609,15 @@ def time_dataframe_describe(self):
609609
self.df.describe()
610610

611611

612-
from .pandas_vb_common import setup # noqa: F401
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+
623+
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/gil.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import numpy as np
2-
import pandas.util.testing as tm
3-
from pandas import DataFrame, Series, read_csv, factorize, date_range
2+
3+
from pandas import DataFrame, Series, date_range, factorize, read_csv
44
from pandas.core.algorithms import take_1d
5+
import pandas.util.testing as tm
56

67
try:
78
from pandas import (
@@ -36,7 +37,7 @@ def wrapper(fname):
3637
return wrapper
3738

3839

39-
from .pandas_vb_common import BaseIO
40+
from .pandas_vb_common import BaseIO # noqa: E402 isort:skip
4041

4142

4243
class ParallelGroupbyMethods:
@@ -301,4 +302,4 @@ def time_loop(self, threads):
301302
self.loop()
302303

303304

304-
from .pandas_vb_common import setup # noqa: F401
305+
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/groupby.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
)
1616
import pandas.util.testing as tm
1717

18-
1918
method_blacklist = {
2019
"object": {
2120
"median",
@@ -626,4 +625,4 @@ def time_first(self):
626625
self.df_nans.groupby("key").transform("first")
627626

628627

629-
from .pandas_vb_common import setup # noqa: F401
628+
from .pandas_vb_common import setup # noqa: F401 isort:skip

0 commit comments

Comments
 (0)