Skip to content

Commit 3129353

Browse files
committed
Merge branch 'master' of https://github.com/pandas-dev/pandas into 29130
2 parents 47e211c + 4291973 commit 3129353

File tree

192 files changed

+3114
-2297
lines changed

Some content is hidden

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

192 files changed

+3114
-2297
lines changed

.github/workflows/pre-commit.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
- uses: pre-commit/action@v2.0.0

.github/workflows/stale-pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
with:
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}
1414
stale-pr-message: "This pull request is stale because it has been open for thirty days with no activity."
15-
skip-stale-pr-message: false
15+
skip-stale-pr-message: true
1616
stale-pr-label: "Stale"
17-
exempt-pr-labels: "Needs Review,Blocked"
17+
exempt-pr-labels: "Needs Review,Blocked,Needs Discussion"
1818
days-before-stale: 30
1919
days-before-close: -1
20-
remove-stale-when-updated: true
21-
debug-only: true
20+
remove-stale-when-updated: false
21+
debug-only: false

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
repos:
22
- repo: https://github.com/python/black
3-
rev: 19.10b0
3+
rev: 20.8b1
44
hooks:
55
- id: black
6-
language_version: python3
76
- repo: https://gitlab.com/pycqa/flake8
8-
rev: 3.7.7
7+
rev: 3.8.3
98
hooks:
109
- id: flake8
11-
language: python_venv
1210
additional_dependencies: [flake8-comprehensions>=3.1.0]
1311
- id: flake8
1412
name: flake8-pyx
15-
language: python_venv
1613
files: \.(pyx|pxd)$
1714
types:
1815
- file
1916
args: [--append-config=flake8/cython.cfg]
2017
- id: flake8
2118
name: flake8-pxd
22-
language: python_venv
2319
files: \.pxi\.in$
2420
types:
2521
- file
2622
args: [--append-config=flake8/cython-template.cfg]
27-
- repo: https://github.com/pre-commit/mirrors-isort
28-
rev: v4.3.21
23+
- repo: https://github.com/PyCQA/isort
24+
rev: 5.2.2
2925
hooks:
3026
- id: isort
31-
language: python_venv
3227
exclude: ^pandas/__init__\.py$|^pandas/core/api\.py$
28+
- repo: https://github.com/asottile/pyupgrade
29+
rev: v2.7.2
30+
hooks:
31+
- id: pyupgrade
32+
args: [--py37-plus]

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ matrix:
4242

4343
- arch: arm64
4444
env:
45-
- JOB="3.7, arm64" PYTEST_WORKERS=8 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard)"
45+
- JOB="3.7, arm64" PYTEST_WORKERS=8 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard and not arm_slow)"
4646

4747
- env:
4848
- JOB="3.7, locale" ENV_FILE="ci/deps/travis-37-locale.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"
@@ -58,10 +58,6 @@ matrix:
5858
services:
5959
- mysql
6060
- postgresql
61-
allow_failures:
62-
- arch: arm64
63-
env:
64-
- JOB="3.7, arm64" PYTEST_WORKERS=8 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard)"
6561

6662

6763
before_install:

asv_bench/benchmarks/arithmetic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def setup(self, op):
125125
arr1 = np.random.randn(n_rows, int(n_cols / 2)).astype("f8")
126126
arr2 = np.random.randn(n_rows, int(n_cols / 2)).astype("f4")
127127
df = pd.concat(
128-
[pd.DataFrame(arr1), pd.DataFrame(arr2)], axis=1, ignore_index=True,
128+
[pd.DataFrame(arr1), pd.DataFrame(arr2)], axis=1, ignore_index=True
129129
)
130130
# should already be the case, but just to be sure
131131
df._consolidate_inplace()

asv_bench/benchmarks/frame_methods.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,46 @@ def time_to_html_mixed(self):
219219
self.df2.to_html()
220220

221221

222+
class ToNumpy:
223+
def setup(self):
224+
N = 10000
225+
M = 10
226+
self.df_tall = DataFrame(np.random.randn(N, M))
227+
self.df_wide = DataFrame(np.random.randn(M, N))
228+
self.df_mixed_tall = self.df_tall.copy()
229+
self.df_mixed_tall["foo"] = "bar"
230+
self.df_mixed_tall[0] = period_range("2000", periods=N)
231+
self.df_mixed_tall[1] = range(N)
232+
self.df_mixed_wide = self.df_wide.copy()
233+
self.df_mixed_wide["foo"] = "bar"
234+
self.df_mixed_wide[0] = period_range("2000", periods=M)
235+
self.df_mixed_wide[1] = range(M)
236+
237+
def time_to_numpy_tall(self):
238+
self.df_tall.to_numpy()
239+
240+
def time_to_numpy_wide(self):
241+
self.df_wide.to_numpy()
242+
243+
def time_to_numpy_mixed_tall(self):
244+
self.df_mixed_tall.to_numpy()
245+
246+
def time_to_numpy_mixed_wide(self):
247+
self.df_mixed_wide.to_numpy()
248+
249+
def time_values_tall(self):
250+
self.df_tall.values
251+
252+
def time_values_wide(self):
253+
self.df_wide.values
254+
255+
def time_values_mixed_tall(self):
256+
self.df_mixed_tall.values
257+
258+
def time_values_mixed_wide(self):
259+
self.df_mixed_wide.values
260+
261+
222262
class Repr:
223263
def setup(self):
224264
nrows = 10000

asv_bench/benchmarks/strings.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@ class Construction:
1313
param_names = ["dtype"]
1414

1515
def setup(self, dtype):
16-
self.data = tm.rands_array(nchars=10 ** 5, size=10)
16+
self.series_arr = tm.rands_array(nchars=10, size=10 ** 5)
17+
self.frame_arr = self.series_arr.reshape((50_000, 2)).copy()
1718

18-
def time_construction(self, dtype):
19-
Series(self.data, dtype=dtype)
19+
def time_series_construction(self, dtype):
20+
Series(self.series_arr, dtype=dtype)
2021

21-
def peakmem_construction(self, dtype):
22-
Series(self.data, dtype=dtype)
22+
def peakmem_series_construction(self, dtype):
23+
Series(self.series_arr, dtype=dtype)
24+
25+
def time_frame_construction(self, dtype):
26+
DataFrame(self.frame_arr, dtype=dtype)
27+
28+
def peakmem_frame_construction(self, dtype):
29+
DataFrame(self.frame_arr, dtype=dtype)
2330

2431

2532
class Methods:

asv_bench/benchmarks/timeseries.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,29 @@ def time_lookup_and_cleanup(self):
263263
self.ts.index._cleanup()
264264

265265

266+
class ToDatetimeFromIntsFloats:
267+
def setup(self):
268+
self.ts_sec = Series(range(1521080307, 1521685107), dtype="int64")
269+
self.ts_sec_float = self.ts_sec.astype("float64")
270+
271+
self.ts_nanosec = 1_000_000 * self.ts_sec
272+
self.ts_nanosec_float = self.ts_nanosec.astype("float64")
273+
274+
# speed of int64 and float64 paths should be comparable
275+
276+
def time_nanosec_int64(self):
277+
to_datetime(self.ts_nanosec, unit="ns")
278+
279+
def time_nanosec_float64(self):
280+
to_datetime(self.ts_nanosec_float, unit="ns")
281+
282+
def time_sec_int64(self):
283+
to_datetime(self.ts_sec, unit="s")
284+
285+
def time_sec_float64(self):
286+
to_datetime(self.ts_sec_float, unit="s")
287+
288+
266289
class ToDatetimeYYYYMMDD:
267290
def setup(self):
268291
rng = date_range(start="1/1/2000", periods=10000, freq="D")

ci/deps/travis-37-arm64.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: pandas-dev
22
channels:
3-
- defaults
43
- conda-forge
54
dependencies:
65
- python=3.7.*

ci/deps/travis-37-cov.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: pandas-dev
22
channels:
3-
- defaults
43
- conda-forge
54
dependencies:
65
- python=3.7.*
@@ -15,7 +14,6 @@ dependencies:
1514
# pandas dependencies
1615
- beautifulsoup4
1716
- botocore>=1.11
18-
- cython>=0.29.16
1917
- dask
2018
- fastparquet>=0.3.2
2119
- fsspec>=0.7.4
@@ -31,16 +29,18 @@ dependencies:
3129
- odfpy
3230
- openpyxl
3331
- pandas-gbq
32+
- google-cloud-bigquery>=1.27.2 # GH 36436
3433
- psycopg2
3534
- pyarrow>=0.15.0
36-
- pymysql
35+
- pymysql=0.7.11
3736
- pytables
3837
- python-snappy
38+
- python-dateutil
3939
- pytz
4040
- s3fs>=0.4.0
4141
- scikit-learn
4242
- scipy
43-
- sqlalchemy
43+
- sqlalchemy=1.3.0
4444
- statsmodels
4545
- xarray
4646
- xlrd
@@ -51,5 +51,4 @@ dependencies:
5151
- brotlipy
5252
- coverage
5353
- pandas-datareader
54-
- python-dateutil
5554
- pyxlsb

0 commit comments

Comments
 (0)