Skip to content

Commit fa2557b

Browse files
authored
Merge branch 'master' into single_level
2 parents a5fee24 + 0159cba commit fa2557b

File tree

282 files changed

+5760
-3825
lines changed

Some content is hidden

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

282 files changed

+5760
-3825
lines changed

.devcontainer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
"python.linting.pylintEnabled": false,
1818
"python.linting.mypyEnabled": true,
1919
"python.testing.pytestEnabled": true,
20-
"python.testing.cwd": "pandas/tests"
20+
"python.testing.pytestArgs": [
21+
"pandas"
22+
]
2123
},
2224

2325
// Add the IDs of extensions you want installed when the container is created in the array below.

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ matrix:
6969
env:
7070
- JOB="3.7, arm64" PYTEST_WORKERS=8 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard)"
7171
- dist: bionic
72-
python: 3.9-dev
7372
env:
74-
- JOB="3.9-dev" PATTERN="(not slow and not network)"
73+
- JOB="3.9-dev" PATTERN="(not slow and not network and not clipboard)"
74+
7575

7676
before_install:
7777
- echo "before_install"

asv_bench/benchmarks/categoricals.py

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def setup(self):
3434
self.values_all_int8 = np.ones(N, "int8")
3535
self.categorical = pd.Categorical(self.values, self.categories)
3636
self.series = pd.Series(self.categorical)
37+
self.intervals = pd.interval_range(0, 1, periods=N // 10)
3738

3839
def time_regular(self):
3940
pd.Categorical(self.values, self.categories)
@@ -44,6 +45,9 @@ def time_fastpath(self):
4445
def time_datetimes(self):
4546
pd.Categorical(self.datetimes)
4647

48+
def time_interval(self):
49+
pd.Categorical(self.datetimes, categories=self.datetimes)
50+
4751
def time_datetimes_with_nat(self):
4852
pd.Categorical(self.datetimes_with_nat)
4953

asv_bench/benchmarks/groupby.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from .pandas_vb_common import tm
1818

19-
method_blacklist = {
19+
method_blocklist = {
2020
"object": {
2121
"median",
2222
"prod",
@@ -403,7 +403,7 @@ class GroupByMethods:
403403
]
404404

405405
def setup(self, dtype, method, application):
406-
if method in method_blacklist.get(dtype, {}):
406+
if method in method_blocklist.get(dtype, {}):
407407
raise NotImplementedError # skip benchmark
408408
ngroups = 1000
409409
size = ngroups * 2

asv_bench/benchmarks/io/json.py

+30
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sys
2+
13
import numpy as np
24

35
from pandas import DataFrame, concat, date_range, read_json, timedelta_range
@@ -82,6 +84,7 @@ def setup(self, orient, frame):
8284
timedeltas = timedelta_range(start=1, periods=N, freq="s")
8385
datetimes = date_range(start=1, periods=N, freq="s")
8486
ints = np.random.randint(100000000, size=N)
87+
longints = sys.maxsize * np.random.randint(100000000, size=N)
8588
floats = np.random.randn(N)
8689
strings = tm.makeStringIndex(N)
8790
self.df = DataFrame(np.random.randn(N, ncols), index=np.arange(N))
@@ -120,6 +123,18 @@ def setup(self, orient, frame):
120123
index=index,
121124
)
122125

126+
self.df_longint_float_str = DataFrame(
127+
{
128+
"longint_1": longints,
129+
"longint_2": longints,
130+
"float_1": floats,
131+
"float_2": floats,
132+
"str_1": strings,
133+
"str_2": strings,
134+
},
135+
index=index,
136+
)
137+
123138
def time_to_json(self, orient, frame):
124139
getattr(self, frame).to_json(self.fname, orient=orient)
125140

@@ -172,6 +187,7 @@ def setup(self):
172187
timedeltas = timedelta_range(start=1, periods=N, freq="s")
173188
datetimes = date_range(start=1, periods=N, freq="s")
174189
ints = np.random.randint(100000000, size=N)
190+
longints = sys.maxsize * np.random.randint(100000000, size=N)
175191
floats = np.random.randn(N)
176192
strings = tm.makeStringIndex(N)
177193
self.df = DataFrame(np.random.randn(N, ncols), index=np.arange(N))
@@ -209,6 +225,17 @@ def setup(self):
209225
},
210226
index=index,
211227
)
228+
self.df_longint_float_str = DataFrame(
229+
{
230+
"longint_1": longints,
231+
"longint_2": longints,
232+
"float_1": floats,
233+
"float_2": floats,
234+
"str_1": strings,
235+
"str_2": strings,
236+
},
237+
index=index,
238+
)
212239

213240
def time_floats_with_int_idex_lines(self):
214241
self.df.to_json(self.fname, orient="records", lines=True)
@@ -225,6 +252,9 @@ def time_float_int_lines(self):
225252
def time_float_int_str_lines(self):
226253
self.df_int_float_str.to_json(self.fname, orient="records", lines=True)
227254

255+
def time_float_longint_str_lines(self):
256+
self.df_longint_float_str.to_json(self.fname, orient="records", lines=True)
257+
228258

229259
class ToJSONMem:
230260
def setup_cache(self):

asv_bench/benchmarks/pandas_vb_common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
np.uint8,
3434
]
3535
datetime_dtypes = [np.datetime64, np.timedelta64]
36-
string_dtypes = [np.object]
36+
string_dtypes = [object]
3737
try:
3838
extension_dtypes = [
3939
pd.Int8Dtype,

asv_bench/benchmarks/series_methods.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,15 @@ def time_isin_nan_values(self):
5858

5959
class IsInForObjects:
6060
def setup(self):
61-
self.s_nans = Series(np.full(10 ** 4, np.nan)).astype(np.object)
62-
self.vals_nans = np.full(10 ** 4, np.nan).astype(np.object)
63-
self.s_short = Series(np.arange(2)).astype(np.object)
64-
self.s_long = Series(np.arange(10 ** 5)).astype(np.object)
65-
self.vals_short = np.arange(2).astype(np.object)
66-
self.vals_long = np.arange(10 ** 5).astype(np.object)
61+
self.s_nans = Series(np.full(10 ** 4, np.nan)).astype(object)
62+
self.vals_nans = np.full(10 ** 4, np.nan).astype(object)
63+
self.s_short = Series(np.arange(2)).astype(object)
64+
self.s_long = Series(np.arange(10 ** 5)).astype(object)
65+
self.vals_short = np.arange(2).astype(object)
66+
self.vals_long = np.arange(10 ** 5).astype(object)
6767
# because of nans floats are special:
68-
self.s_long_floats = Series(np.arange(10 ** 5, dtype=np.float)).astype(
69-
np.object
70-
)
71-
self.vals_long_floats = np.arange(10 ** 5, dtype=np.float).astype(np.object)
68+
self.s_long_floats = Series(np.arange(10 ** 5, dtype=np.float)).astype(object)
69+
self.vals_long_floats = np.arange(10 ** 5, dtype=np.float).astype(object)
7270

7371
def time_isin_nans(self):
7472
# if nan-objects are different objects,

asv_bench/benchmarks/sparse.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def time_series_to_frame(self):
3232

3333
class SparseArrayConstructor:
3434

35-
params = ([0.1, 0.01], [0, np.nan], [np.int64, np.float64, np.object])
35+
params = ([0.1, 0.01], [0, np.nan], [np.int64, np.float64, object])
3636
param_names = ["dense_proportion", "fill_value", "dtype"]
3737

3838
def setup(self, dense_proportion, fill_value, dtype):

ci/code_checks.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -248,19 +248,19 @@ fi
248248
### CODE ###
249249
if [[ -z "$CHECK" || "$CHECK" == "code" ]]; then
250250

251-
MSG='Check import. No warnings, and blacklist some optional dependencies' ; echo $MSG
251+
MSG='Check import. No warnings, and blocklist some optional dependencies' ; echo $MSG
252252
python -W error -c "
253253
import sys
254254
import pandas
255255
256-
blacklist = {'bs4', 'gcsfs', 'html5lib', 'http', 'ipython', 'jinja2', 'hypothesis',
256+
blocklist = {'bs4', 'gcsfs', 'html5lib', 'http', 'ipython', 'jinja2', 'hypothesis',
257257
'lxml', 'matplotlib', 'numexpr', 'openpyxl', 'py', 'pytest', 's3fs', 'scipy',
258258
'tables', 'urllib.request', 'xlrd', 'xlsxwriter', 'xlwt'}
259259
260260
# GH#28227 for some of these check for top-level modules, while others are
261261
# more specific (e.g. urllib.request)
262262
import_mods = set(m.split('.')[0] for m in sys.modules) | set(sys.modules)
263-
mods = blacklist & import_mods
263+
mods = blocklist & import_mods
264264
if mods:
265265
sys.stderr.write('err: pandas should not import: {}\n'.format(', '.join(mods)))
266266
sys.exit(len(mods))

ci/deps/azure-36-locale.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ dependencies:
1515

1616
# pandas dependencies
1717
- beautifulsoup4
18-
- gcsfs
1918
- html5lib
2019
- ipython
2120
- jinja2
@@ -31,7 +30,6 @@ dependencies:
3130
- pytables
3231
- python-dateutil
3332
- pytz
34-
- s3fs
3533
- scipy
3634
- xarray
3735
- xlrd

ci/deps/azure-37-locale.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ dependencies:
2727
- pytables
2828
- python-dateutil
2929
- pytz
30-
- s3fs
3130
- scipy
3231
- xarray
3332
- xlrd

ci/deps/azure-windows-37.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ dependencies:
1515
# pandas dependencies
1616
- beautifulsoup4
1717
- bottleneck
18-
- gcsfs
18+
- fsspec>=0.7.4
19+
- gcsfs>=0.6.0
1920
- html5lib
2021
- jinja2
2122
- lxml
@@ -28,7 +29,7 @@ dependencies:
2829
- pytables
2930
- python-dateutil
3031
- pytz
31-
- s3fs
32+
- s3fs>=0.4.0
3233
- scipy
3334
- sqlalchemy
3435
- xlrd

ci/deps/travis-36-cov.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ dependencies:
1818
- cython>=0.29.16
1919
- dask
2020
- fastparquet>=0.3.2
21-
- gcsfs
21+
- fsspec>=0.7.4
22+
- gcsfs>=0.6.0
2223
- geopandas
2324
- html5lib
2425
- matplotlib
@@ -35,7 +36,7 @@ dependencies:
3536
- pytables
3637
- python-snappy
3738
- pytz
38-
- s3fs
39+
- s3fs>=0.4.0
3940
- scikit-learn
4041
- scipy
4142
- sqlalchemy

ci/deps/travis-36-locale.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ dependencies:
1616
- blosc=1.14.3
1717
- python-blosc
1818
- fastparquet=0.3.2
19-
- gcsfs=0.2.2
2019
- html5lib
2120
- ipython
2221
- jinja2
@@ -33,7 +32,6 @@ dependencies:
3332
- pytables
3433
- python-dateutil
3534
- pytz
36-
- s3fs=0.3.0
3735
- scipy
3836
- sqlalchemy=1.1.4
3937
- xarray=0.10

ci/deps/travis-36-slow.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies:
1313

1414
# pandas dependencies
1515
- beautifulsoup4
16+
- fsspec>=0.7.4
1617
- html5lib
1718
- lxml
1819
- matplotlib
@@ -25,7 +26,7 @@ dependencies:
2526
- pytables
2627
- python-dateutil
2728
- pytz
28-
- s3fs
29+
- s3fs>=0.4.0
2930
- scipy
3031
- sqlalchemy
3132
- xlrd

ci/deps/travis-37.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ dependencies:
1313

1414
# pandas dependencies
1515
- botocore>=1.11
16+
- fsspec>=0.7.4
1617
- numpy
1718
- python-dateutil
1819
- nomkl
1920
- pyarrow
2021
- pytz
21-
- s3fs
22+
- s3fs>=0.4.0
2223
- tabulate
2324
- pyreadstat
2425
- pip

doc/redirects.csv

+5-5
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ generated/pandas.core.resample.Resampler.std,../reference/api/pandas.core.resamp
269269
generated/pandas.core.resample.Resampler.sum,../reference/api/pandas.core.resample.Resampler.sum
270270
generated/pandas.core.resample.Resampler.transform,../reference/api/pandas.core.resample.Resampler.transform
271271
generated/pandas.core.resample.Resampler.var,../reference/api/pandas.core.resample.Resampler.var
272-
generated/pandas.core.window.EWM.corr,../reference/api/pandas.core.window.EWM.corr
273-
generated/pandas.core.window.EWM.cov,../reference/api/pandas.core.window.EWM.cov
274-
generated/pandas.core.window.EWM.mean,../reference/api/pandas.core.window.EWM.mean
275-
generated/pandas.core.window.EWM.std,../reference/api/pandas.core.window.EWM.std
276-
generated/pandas.core.window.EWM.var,../reference/api/pandas.core.window.EWM.var
272+
generated/pandas.core.window.ExponentialMovingWindow.corr,../reference/api/pandas.core.window.ExponentialMovingWindow.corr
273+
generated/pandas.core.window.ExponentialMovingWindow.cov,../reference/api/pandas.core.window.ExponentialMovingWindow.cov
274+
generated/pandas.core.window.ExponentialMovingWindow.mean,../reference/api/pandas.core.window.ExponentialMovingWindow.mean
275+
generated/pandas.core.window.ExponentialMovingWindow.std,../reference/api/pandas.core.window.ExponentialMovingWindow.std
276+
generated/pandas.core.window.ExponentialMovingWindow.var,../reference/api/pandas.core.window.ExponentialMovingWindow.var
277277
generated/pandas.core.window.Expanding.aggregate,../reference/api/pandas.core.window.Expanding.aggregate
278278
generated/pandas.core.window.Expanding.apply,../reference/api/pandas.core.window.Expanding.apply
279279
generated/pandas.core.window.Expanding.corr,../reference/api/pandas.core.window.Expanding.corr

doc/source/getting_started/install.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,9 @@ SQLAlchemy 1.1.4 SQL support for databases other tha
267267
SciPy 0.19.0 Miscellaneous statistical functions
268268
XLsxWriter 0.9.8 Excel writing
269269
blosc Compression for HDF5
270+
fsspec 0.7.4 Handling files aside from local and HTTP
270271
fastparquet 0.3.2 Parquet reading / writing
271-
gcsfs 0.2.2 Google Cloud Storage access
272+
gcsfs 0.6.0 Google Cloud Storage access
272273
html5lib HTML parser for read_html (see :ref:`note <optional_html>`)
273274
lxml 3.8.0 HTML parser for read_html (see :ref:`note <optional_html>`)
274275
matplotlib 2.2.2 Visualization
@@ -282,7 +283,7 @@ pyreadstat SPSS files (.sav) reading
282283
pytables 3.4.3 HDF5 reading / writing
283284
pyxlsb 1.0.6 Reading for xlsb files
284285
qtpy Clipboard I/O
285-
s3fs 0.3.0 Amazon S3 access
286+
s3fs 0.4.0 Amazon S3 access
286287
tabulate 0.8.3 Printing in Markdown-friendly format (see `tabulate`_)
287288
xarray 0.8.2 pandas-like API for N-dimensional data
288289
xclip Clipboard I/O on linux

0 commit comments

Comments
 (0)