Skip to content

Commit 9f703f1

Browse files
authored
Merge branch 'master' into mypy/base
2 parents 954a2a3 + 4ca4dd3 commit 9f703f1

File tree

841 files changed

+8517
-2461
lines changed

Some content is hidden

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

841 files changed

+8517
-2461
lines changed

.github/workflows/ci.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ jobs:
154154
source activate pandas-dev
155155
pytest pandas/tests/frame/methods --array-manager
156156
157-
# indexing iset related (temporary since other tests don't pass yet)
157+
# indexing subset (temporary since other tests don't pass yet)
158+
pytest pandas/tests/frame/indexing/test_indexing.py::TestDataFrameIndexing::test_setitem_boolean --array-manager
159+
pytest pandas/tests/frame/indexing/test_where.py --array-manager
158160
pytest pandas/tests/frame/indexing/test_indexing.py::TestDataFrameIndexing::test_setitem_multi_index --array-manager
159161
pytest pandas/tests/frame/indexing/test_setitem.py::TestDataFrameSetItem::test_setitem_listlike_indexer_duplicate_columns --array-manager
160162
pytest pandas/tests/indexing/multiindex/test_setitem.py::TestMultiIndexSetItem::test_astype_assignment_with_dups --array-manager

MANIFEST.in

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
include MANIFEST.in
2-
include LICENSE
31
include RELEASE.md
4-
include README.md
5-
include setup.py
6-
include pyproject.toml
72

83
graft doc
94
prune doc/build
@@ -16,10 +11,12 @@ global-exclude *.bz2
1611
global-exclude *.csv
1712
global-exclude *.dta
1813
global-exclude *.feather
14+
global-exclude *.tar
1915
global-exclude *.gz
2016
global-exclude *.h5
2117
global-exclude *.html
2218
global-exclude *.json
19+
global-exclude *.jsonl
2320
global-exclude *.pickle
2421
global-exclude *.png
2522
global-exclude *.pyc
@@ -40,6 +37,11 @@ global-exclude .DS_Store
4037
global-exclude .git*
4138
global-exclude \#*
4239

40+
# GH 39321
41+
# csv_dir_path fixture checks the existence of the directory
42+
# exclude the whole directory to avoid running related tests in sdist
43+
prune pandas/tests/io/parser/data
44+
4345
include versioneer.py
4446
include pandas/_version.py
4547
include pandas/io/formats/templates/*.tpl

asv_bench/benchmarks/arithmetic.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
import numpy as np
55

66
import pandas as pd
7-
from pandas import DataFrame, Series, Timestamp, date_range, to_timedelta
7+
from pandas import (
8+
DataFrame,
9+
Series,
10+
Timestamp,
11+
date_range,
12+
to_timedelta,
13+
)
814
import pandas._testing as tm
915
from pandas.core.algorithms import checked_add_with_arr
1016

asv_bench/benchmarks/ctors.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import numpy as np
22

3-
from pandas import DatetimeIndex, Index, MultiIndex, Series, Timestamp
3+
from pandas import (
4+
DatetimeIndex,
5+
Index,
6+
MultiIndex,
7+
Series,
8+
Timestamp,
9+
)
410

511
from .pandas_vb_common import tm
612

asv_bench/benchmarks/dtypes.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
import pandas as pd
66
from pandas import DataFrame
77
import pandas._testing as tm
8-
from pandas.api.types import is_extension_array_dtype, pandas_dtype
8+
from pandas.api.types import (
9+
is_extension_array_dtype,
10+
pandas_dtype,
11+
)
912

1013
from .pandas_vb_common import (
1114
datetime_dtypes,

asv_bench/benchmarks/frame_ctor.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
import numpy as np
22

33
import pandas as pd
4-
from pandas import DataFrame, MultiIndex, Series, Timestamp, date_range
4+
from pandas import (
5+
DataFrame,
6+
MultiIndex,
7+
Series,
8+
Timestamp,
9+
date_range,
10+
)
511

612
from .pandas_vb_common import tm
713

814
try:
9-
from pandas.tseries.offsets import Hour, Nano
15+
from pandas.tseries.offsets import (
16+
Hour,
17+
Nano,
18+
)
1019
except ImportError:
1120
# For compatibility with older versions
1221
from pandas.core.datetools import * # noqa

asv_bench/benchmarks/frame_methods.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33

44
import numpy as np
55

6-
from pandas import DataFrame, MultiIndex, NaT, Series, date_range, isnull, period_range
6+
from pandas import (
7+
DataFrame,
8+
MultiIndex,
9+
NaT,
10+
Series,
11+
date_range,
12+
isnull,
13+
period_range,
14+
)
715

816
from .pandas_vb_common import tm
917

asv_bench/benchmarks/gil.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import numpy as np
22

3-
from pandas import DataFrame, Series, date_range, factorize, read_csv
3+
from pandas import (
4+
DataFrame,
5+
Series,
6+
date_range,
7+
factorize,
8+
read_csv,
9+
)
410
from pandas.core.algorithms import take_nd
511

612
from .pandas_vb_common import tm

asv_bench/benchmarks/groupby.py

+23
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,29 @@ def time_dtype_as_field(self, dtype, method, application):
461461
self.as_field_method()
462462

463463

464+
class GroupByCythonAgg:
465+
"""
466+
Benchmarks specifically targetting our cython aggregation algorithms
467+
(using a big enough dataframe with simple key, so a large part of the
468+
time is actually spent in the grouped aggregation).
469+
"""
470+
471+
param_names = ["dtype", "method"]
472+
params = [
473+
["float64"],
474+
["sum", "prod", "min", "max", "mean", "median", "var", "first", "last"],
475+
]
476+
477+
def setup(self, dtype, method):
478+
N = 1_000_000
479+
df = DataFrame(np.random.randn(N, 10), columns=list("abcdefghij"))
480+
df["key"] = np.random.randint(0, 100, size=N)
481+
self.df = df
482+
483+
def time_frame_agg(self, dtype, method):
484+
self.df.groupby("key").agg(method)
485+
486+
464487
class RankWithTies:
465488
# GH 21237
466489
param_names = ["dtype", "tie_method"]

asv_bench/benchmarks/inference.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import numpy as np
22

3-
from pandas import Series, to_numeric
4-
5-
from .pandas_vb_common import lib, tm
3+
from pandas import (
4+
Series,
5+
to_numeric,
6+
)
7+
8+
from .pandas_vb_common import (
9+
lib,
10+
tm,
11+
)
612

713

814
class ToNumeric:

asv_bench/benchmarks/io/csv.py

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1-
from io import BytesIO, StringIO
1+
from io import (
2+
BytesIO,
3+
StringIO,
4+
)
25
import random
36
import string
47

58
import numpy as np
69

7-
from pandas import Categorical, DataFrame, date_range, read_csv, to_datetime
8-
9-
from ..pandas_vb_common import BaseIO, tm
10+
from pandas import (
11+
Categorical,
12+
DataFrame,
13+
date_range,
14+
read_csv,
15+
to_datetime,
16+
)
17+
18+
from ..pandas_vb_common import (
19+
BaseIO,
20+
tm,
21+
)
1022

1123

1224
class ToCSV(BaseIO):

asv_bench/benchmarks/io/excel.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@
22

33
import numpy as np
44
from odf.opendocument import OpenDocumentSpreadsheet
5-
from odf.table import Table, TableCell, TableRow
5+
from odf.table import (
6+
Table,
7+
TableCell,
8+
TableRow,
9+
)
610
from odf.text import P
711

8-
from pandas import DataFrame, ExcelWriter, date_range, read_excel
12+
from pandas import (
13+
DataFrame,
14+
ExcelWriter,
15+
date_range,
16+
read_excel,
17+
)
918

1019
from ..pandas_vb_common import tm
1120

asv_bench/benchmarks/io/hdf.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
import numpy as np
22

3-
from pandas import DataFrame, HDFStore, date_range, read_hdf
4-
5-
from ..pandas_vb_common import BaseIO, tm
3+
from pandas import (
4+
DataFrame,
5+
HDFStore,
6+
date_range,
7+
read_hdf,
8+
)
9+
10+
from ..pandas_vb_common import (
11+
BaseIO,
12+
tm,
13+
)
614

715

816
class HDFStoreDataFrame(BaseIO):

asv_bench/benchmarks/io/json.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22

33
import numpy as np
44

5-
from pandas import DataFrame, concat, date_range, read_json, timedelta_range
6-
7-
from ..pandas_vb_common import BaseIO, tm
5+
from pandas import (
6+
DataFrame,
7+
concat,
8+
date_range,
9+
read_json,
10+
timedelta_range,
11+
)
12+
13+
from ..pandas_vb_common import (
14+
BaseIO,
15+
tm,
16+
)
817

918

1019
class ReadJSON(BaseIO):

asv_bench/benchmarks/io/pickle.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
import numpy as np
22

3-
from pandas import DataFrame, date_range, read_pickle
4-
5-
from ..pandas_vb_common import BaseIO, tm
3+
from pandas import (
4+
DataFrame,
5+
date_range,
6+
read_pickle,
7+
)
8+
9+
from ..pandas_vb_common import (
10+
BaseIO,
11+
tm,
12+
)
613

714

815
class Pickle(BaseIO):

asv_bench/benchmarks/io/sql.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
import numpy as np
44
from sqlalchemy import create_engine
55

6-
from pandas import DataFrame, date_range, read_sql_query, read_sql_table
6+
from pandas import (
7+
DataFrame,
8+
date_range,
9+
read_sql_query,
10+
read_sql_table,
11+
)
712

813
from ..pandas_vb_common import tm
914

asv_bench/benchmarks/io/stata.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
import numpy as np
22

3-
from pandas import DataFrame, date_range, read_stata
4-
5-
from ..pandas_vb_common import BaseIO, tm
3+
from pandas import (
4+
DataFrame,
5+
date_range,
6+
read_stata,
7+
)
8+
9+
from ..pandas_vb_common import (
10+
BaseIO,
11+
tm,
12+
)
613

714

815
class Stata(BaseIO):

asv_bench/benchmarks/join_merge.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
import numpy as np
44

5-
from pandas import DataFrame, MultiIndex, Series, concat, date_range, merge, merge_asof
5+
from pandas import (
6+
DataFrame,
7+
MultiIndex,
8+
Series,
9+
concat,
10+
date_range,
11+
merge,
12+
merge_asof,
13+
)
614

715
from .pandas_vb_common import tm
816

asv_bench/benchmarks/multiindex_object.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
import numpy as np
44

5-
from pandas import DataFrame, MultiIndex, RangeIndex, date_range
5+
from pandas import (
6+
DataFrame,
7+
MultiIndex,
8+
RangeIndex,
9+
date_range,
10+
)
611

712
from .pandas_vb_common import tm
813

asv_bench/benchmarks/period.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
Period benchmarks with non-tslibs dependencies. See
33
benchmarks.tslibs.period for benchmarks that rely only on tslibs.
44
"""
5-
from pandas import DataFrame, Period, PeriodIndex, Series, date_range, period_range
5+
from pandas import (
6+
DataFrame,
7+
Period,
8+
PeriodIndex,
9+
Series,
10+
date_range,
11+
period_range,
12+
)
613

714
from pandas.tseries.frequencies import to_offset
815

asv_bench/benchmarks/plotting.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import matplotlib
22
import numpy as np
33

4-
from pandas import DataFrame, DatetimeIndex, Series, date_range
4+
from pandas import (
5+
DataFrame,
6+
DatetimeIndex,
7+
Series,
8+
date_range,
9+
)
510

611
try:
712
from pandas.plotting import andrews_curves

0 commit comments

Comments
 (0)