Skip to content

Commit 69f7336

Browse files
committed
Merge remote-tracking branch 'upstream/master' into multiindex_at_fix
2 parents 67b8150 + 25e5a74 commit 69f7336

File tree

248 files changed

+4360
-3074
lines changed

Some content is hidden

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

248 files changed

+4360
-3074
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
3+
name: Bug Report
4+
about: Create a bug report to help us improve pandas
5+
title: "BUG:"
6+
labels: "Bug, Needs Triage"
7+
8+
---
9+
10+
- [ ] I have checked that this issue has not already been reported.
11+
12+
- [ ] I have confirmed this bug exists on the latest version of pandas.
13+
14+
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
15+
16+
---
17+
18+
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
19+
20+
#### Code Sample, a copy-pastable example
21+
22+
```python
23+
# Your code here
24+
25+
```
26+
27+
#### Problem description
28+
29+
[this should explain **why** the current behaviour is a problem and why the expected output is a better solution]
30+
31+
#### Expected Output
32+
33+
#### Output of ``pd.show_versions()``
34+
35+
<details>
36+
37+
[paste the output of ``pd.show_versions()`` here leaving a blank line after the details tag]
38+
39+
</details>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
3+
name: Documentation Improvement
4+
about: Report wrong or missing documentation
5+
title: "DOC:"
6+
labels: "Docs, Needs Triage"
7+
8+
---
9+
10+
#### Location of the documentation
11+
12+
[this should provide the location of the documentation, e.g. "pandas.read_csv" or the URL of the documentation, e.g. "https://dev.pandas.io/docs/reference/api/pandas.read_csv.html"]
13+
14+
**Note**: You can check the latest versions of the docs on `master` [here](https://dev.pandas.io/docs).
15+
16+
#### Documentation problem
17+
18+
[this should provide a description of what documentation you believe needs to be fixed/improved]
19+
20+
#### Suggested fix for documentation
21+
22+
[this should explain the suggested fix and **why** it's better than the existing documentation]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
3+
name: Feature Request
4+
about: Suggest an idea for pandas
5+
title: "ENH:"
6+
labels: "Enhancement, Needs Triage"
7+
8+
---
9+
10+
#### Is your feature request related to a problem?
11+
12+
[this should provide a description of what the problem is, e.g. "I wish I could use pandas to do [...]"]
13+
14+
#### Describe the solution you'd like
15+
16+
[this should provide a description of the feature request, e.g. "`DataFrame.foo` should get a new parameter `bar` that [...]", try to write a docstring for the desired feature]
17+
18+
#### API breaking implications
19+
20+
[this should provide a description of how this feature will affect the API]
21+
22+
#### Describe alternatives you've considered
23+
24+
[this should provide a description of any alternative solutions or features you've considered]
25+
26+
#### Additional context
27+
28+
[add any other context, code examples, or references to existing implementations about the feature request here]
29+
30+
```python
31+
# Your code here, if applicable
32+
33+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
3+
name: Submit Question
4+
about: Ask a general question about pandas
5+
title: "QST:"
6+
labels: "Usage Question, Needs Triage"
7+
8+
---
9+
10+
- [ ] I have searched the [[pandas] tag](https://stackoverflow.com/questions/tagged/pandas) on StackOverflow for similar questions.
11+
12+
- [ ] I have asked my usage related question on [StackOverflow](https://stackoverflow.com).
13+
14+
---
15+
16+
#### Question about pandas
17+
18+
**Note**: If you'd still like to submit a question, please read [this guide](
19+
https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your question.
20+
21+
```python
22+
# Your code here, if applicable
23+
24+
```

asv_bench/benchmarks/arithmetic.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,23 @@ def time_frame_op_with_scalar(self, dtype, scalar, op):
5050
op(self.df, scalar)
5151

5252

53+
class OpWithFillValue:
54+
def setup(self):
55+
# GH#31300
56+
arr = np.arange(10 ** 6)
57+
df = DataFrame({"A": arr})
58+
ser = df["A"]
59+
60+
self.df = df
61+
self.ser = ser
62+
63+
def time_frame_op_with_fill_value_no_nas(self):
64+
self.df.add(self.df, fill_value=4)
65+
66+
def time_series_op_with_fill_value_no_nas(self):
67+
self.ser.add(self.ser, fill_value=4)
68+
69+
5370
class MixedFrameWithSeriesAxis0:
5471
params = [
5572
[

asv_bench/benchmarks/finalize.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import pandas as pd
2+
3+
4+
class Finalize:
5+
param_names = ["series", "frame"]
6+
params = [pd.Series, pd.DataFrame]
7+
8+
def setup(self, param):
9+
N = 1000
10+
obj = param(dtype=float)
11+
for i in range(N):
12+
obj.attrs[i] = i
13+
self.obj = obj
14+
15+
def time_finalize_micro(self, param):
16+
self.obj.__finalize__(self.obj, method="__finalize__")

ci/code_checks.sh

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
121121

122122
# Imports - Check formatting using isort see setup.cfg for settings
123123
MSG='Check import format using isort' ; echo $MSG
124-
ISORT_CMD="isort --quiet --recursive --check-only pandas asv_bench"
124+
ISORT_CMD="isort --quiet --recursive --check-only pandas asv_bench scripts"
125125
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
126126
eval $ISORT_CMD | awk '{print "##[error]" $0}'; RET=$(($RET + ${PIPESTATUS[0]}))
127127
else
@@ -266,63 +266,78 @@ fi
266266
### DOCTESTS ###
267267
if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then
268268

269+
# Individual files
270+
271+
MSG='Doctests accessor.py' ; echo $MSG
272+
pytest -q --doctest-modules pandas/core/accessor.py
273+
RET=$(($RET + $?)) ; echo $MSG "DONE"
274+
275+
MSG='Doctests base.py' ; echo $MSG
276+
pytest -q --doctest-modules pandas/core/base.py
277+
RET=$(($RET + $?)) ; echo $MSG "DONE"
278+
279+
MSG='Doctests construction.py' ; echo $MSG
280+
pytest -q --doctest-modules pandas/core/construction.py
281+
RET=$(($RET + $?)) ; echo $MSG "DONE"
282+
269283
MSG='Doctests frame.py' ; echo $MSG
270284
pytest -q --doctest-modules pandas/core/frame.py
271285
RET=$(($RET + $?)) ; echo $MSG "DONE"
272286

273-
MSG='Doctests series.py' ; echo $MSG
274-
pytest -q --doctest-modules pandas/core/series.py \
275-
-k"-nonzero -reindex -searchsorted -to_dict"
287+
MSG='Doctests generic.py' ; echo $MSG
288+
pytest -q --doctest-modules pandas/core/generic.py
276289
RET=$(($RET + $?)) ; echo $MSG "DONE"
277290

278291
MSG='Doctests groupby.py' ; echo $MSG
279292
pytest -q --doctest-modules pandas/core/groupby/groupby.py -k"-cumcount -describe -pipe"
280293
RET=$(($RET + $?)) ; echo $MSG "DONE"
281294

282-
MSG='Doctests datetimes.py' ; echo $MSG
283-
pytest -q --doctest-modules pandas/core/tools/datetimes.py
295+
MSG='Doctests series.py' ; echo $MSG
296+
pytest -q --doctest-modules pandas/core/series.py
284297
RET=$(($RET + $?)) ; echo $MSG "DONE"
285298

286-
MSG='Doctests reshaping functions' ; echo $MSG
287-
pytest -q --doctest-modules pandas/core/reshape/
299+
MSG='Doctests strings.py' ; echo $MSG
300+
pytest -q --doctest-modules pandas/core/strings.py
288301
RET=$(($RET + $?)) ; echo $MSG "DONE"
289302

290-
MSG='Doctests interval classes' ; echo $MSG
291-
pytest -q --doctest-modules \
292-
pandas/core/indexes/interval.py \
293-
pandas/core/arrays/interval.py
294-
RET=$(($RET + $?)) ; echo $MSG "DONE"
303+
# Directories
295304

296305
MSG='Doctests arrays'; echo $MSG
297-
pytest -q --doctest-modules \
298-
pandas/core/arrays/string_.py \
299-
pandas/core/arrays/integer.py \
300-
pandas/core/arrays/boolean.py
306+
pytest -q --doctest-modules pandas/core/arrays/
307+
RET=$(($RET + $?)) ; echo $MSG "DONE"
308+
309+
MSG='Doctests computation' ; echo $MSG
310+
pytest -q --doctest-modules pandas/core/computation/
301311
RET=$(($RET + $?)) ; echo $MSG "DONE"
302312

303313
MSG='Doctests dtypes'; echo $MSG
304314
pytest -q --doctest-modules pandas/core/dtypes/
305315
RET=$(($RET + $?)) ; echo $MSG "DONE"
306316

307-
MSG='Doctests arrays/boolean.py' ; echo $MSG
308-
pytest -q --doctest-modules pandas/core/arrays/boolean.py
317+
MSG='Doctests indexes' ; echo $MSG
318+
pytest -q --doctest-modules pandas/core/indexes/
309319
RET=$(($RET + $?)) ; echo $MSG "DONE"
310320

311-
MSG='Doctests base.py' ; echo $MSG
312-
pytest -q --doctest-modules pandas/core/base.py
321+
MSG='Doctests ops' ; echo $MSG
322+
pytest -q --doctest-modules pandas/core/ops/
313323
RET=$(($RET + $?)) ; echo $MSG "DONE"
314324

315-
MSG='Doctests construction.py' ; echo $MSG
316-
pytest -q --doctest-modules pandas/core/construction.py
325+
MSG='Doctests reshape' ; echo $MSG
326+
pytest -q --doctest-modules pandas/core/reshape/
317327
RET=$(($RET + $?)) ; echo $MSG "DONE"
318328

319-
MSG='Doctests generic.py' ; echo $MSG
320-
pytest -q --doctest-modules pandas/core/generic.py
329+
MSG='Doctests tools' ; echo $MSG
330+
pytest -q --doctest-modules pandas/core/tools/
331+
RET=$(($RET + $?)) ; echo $MSG "DONE"
332+
333+
MSG='Doctests window' ; echo $MSG
334+
pytest -q --doctest-modules pandas/core/window/
321335
RET=$(($RET + $?)) ; echo $MSG "DONE"
322336

323337
MSG='Doctests tseries' ; echo $MSG
324338
pytest -q --doctest-modules pandas/tseries/
325339
RET=$(($RET + $?)) ; echo $MSG "DONE"
340+
326341
fi
327342

328343
### DOCSTRINGS ###
@@ -333,7 +348,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
333348
RET=$(($RET + $?)) ; echo $MSG "DONE"
334349

335350
MSG='Validate correct capitalization among titles in documentation' ; echo $MSG
336-
$BASE_DIR/scripts/validate_rst_title_capitalization.py $BASE_DIR/doc/source/development/contributing.rst
351+
$BASE_DIR/scripts/validate_rst_title_capitalization.py $BASE_DIR/doc/source/development/contributing.rst $BASE_DIR/doc/source/reference
337352
RET=$(($RET + $?)) ; echo $MSG "DONE"
338353

339354
fi

doc/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
)
110110
)
111111
autosummary_generate = True if pattern is None else ["index"]
112+
autodoc_typehints = "none"
112113

113114
# numpydoc
114115
numpydoc_attributes_as_param_list = False

doc/source/development/code_style.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ consistent code format throughout the project. For details see the
1818
Patterns
1919
========
2020

21-
foo.__class__
22-
-------------
21+
Using foo.__class__
22+
-------------------
2323

2424

2525
pandas uses 'type(foo)' instead 'foo.__class__' as it is making the code more
@@ -47,8 +47,8 @@ String formatting
4747
Concatenated strings
4848
--------------------
4949

50-
f-strings
51-
~~~~~~~~~
50+
Using f-strings
51+
~~~~~~~~~~~~~~~
5252

5353
pandas uses f-strings formatting instead of '%' and '.format()' string formatters.
5454

doc/source/development/contributing.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Below is a brief overview on how to set-up a virtual environment with Powershell
295295
under Windows. For details please refer to the
296296
`official virtualenv user guide <https://virtualenv.pypa.io/en/stable/userguide/#activate-script>`__
297297

298-
Use an ENV_DIR of your choice. We'll use ~\virtualenvs\pandas-dev where
298+
Use an ENV_DIR of your choice. We'll use ~\\virtualenvs\\pandas-dev where
299299
'~' is the folder pointed to by either $env:USERPROFILE (Powershell) or
300300
%USERPROFILE% (cmd.exe) environment variable. Any parent directories
301301
should already exist.
@@ -791,7 +791,7 @@ the ``pandas.util._decorators.deprecate``:
791791
792792
from pandas.util._decorators import deprecate
793793
794-
deprecate('old_func', 'new_func', '0.21.0')
794+
deprecate('old_func', 'new_func', '1.1.0')
795795
796796
Otherwise, you need to do it manually:
797797

@@ -803,7 +803,7 @@ Otherwise, you need to do it manually:
803803
def old_func():
804804
"""Summary of the function.
805805
806-
.. deprecated:: 0.21.0
806+
.. deprecated:: 1.1.0
807807
Use new_func instead.
808808
"""
809809
warnings.warn('Use new_func instead.', FutureWarning, stacklevel=2)
@@ -1354,9 +1354,9 @@ directive is used. The sphinx syntax for that is:
13541354

13551355
.. code-block:: rst
13561356
1357-
.. versionadded:: 0.21.0
1357+
.. versionadded:: 1.1.0
13581358
1359-
This will put the text *New in version 0.21.0* wherever you put the sphinx
1359+
This will put the text *New in version 1.1.0* wherever you put the sphinx
13601360
directive. This should also be put in the docstring when adding a new function
13611361
or method (`example <https://github.com/pandas-dev/pandas/blob/v0.20.2/pandas/core/frame.py#L1495>`__)
13621362
or a new keyword argument (`example <https://github.com/pandas-dev/pandas/blob/v0.20.2/pandas/core/generic.py#L568>`__).

0 commit comments

Comments
 (0)