Skip to content

Commit 897a614

Browse files
Merge remote-tracking branch 'upstream/master' into bisect
2 parents b32e7b6 + 7556d29 commit 897a614

Some content is hidden

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

60 files changed

+948
-298
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Bug Report
2+
description: Report incorrect behavior in the pandas library
3+
title: "BUG: "
4+
labels: [Bug, Needs Triage]
5+
6+
body:
7+
- type: checkboxes
8+
id: checks
9+
attributes:
10+
options:
11+
- label: >
12+
I have checked that this issue has not already been reported.
13+
required: true
14+
- label: >
15+
I have confirmed this bug exists on the
16+
[latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
17+
required: true
18+
- label: >
19+
I have confirmed this bug exists on the master branch of pandas.
20+
- type: textarea
21+
id: example
22+
attributes:
23+
label: Reproducible Example
24+
description: >
25+
Please follow [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) on how to
26+
provide a minimal, copy-pastable example.
27+
placeholder: >
28+
import pandas as pd
29+
30+
df = pd.DataFrame(range(5))
31+
32+
...
33+
render: python
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: problem
38+
attributes:
39+
label: Issue Description
40+
description: >
41+
Please provide a description of the issue shown in the reproducible example.
42+
validations:
43+
required: true
44+
- type: textarea
45+
id: expected-behavior
46+
attributes:
47+
label: Expected Behavior
48+
description: >
49+
Please describe or show a code example of the expected behavior.
50+
validations:
51+
required: true
52+
- type: textarea
53+
id: version
54+
attributes:
55+
label: Installed Versions
56+
description: >
57+
Please paste the output of ``pd.show_versions()``
58+
value: >
59+
<details>
60+
61+
62+
Replace this line with the output of pd.show_versions()
63+
64+
65+
</details>
66+
validations:
67+
required: true
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Installation Issue
2+
description: Report issues installing the pandas library on your system
3+
title: "BUILD: "
4+
labels: [Build, Needs Triage]
5+
6+
body:
7+
- type: checkboxes
8+
id: checks
9+
attributes:
10+
options:
11+
- label: >
12+
I have read the [installation guide](https://pandas.pydata.org/pandas-docs/stable/getting_started/install.html#installing-pandas).
13+
required: true
14+
- type: input
15+
id: platform
16+
attributes:
17+
label: Platform
18+
description: >
19+
Please provide the output of ``import platform; print(platform.platform())``
20+
validations:
21+
required: true
22+
- type: dropdown
23+
id: method
24+
attributes:
25+
label: Installation Method
26+
description: >
27+
Please provide how you tried to install pandas from a clean environment.
28+
options:
29+
- pip install
30+
- conda install
31+
- apt-get install
32+
- Built from source
33+
- Other
34+
validations:
35+
required: true
36+
- type: input
37+
id: pandas
38+
attributes:
39+
label: pandas Version
40+
description: >
41+
Please provide the version of pandas you are trying to install.
42+
validations:
43+
required: true
44+
- type: input
45+
id: python
46+
attributes:
47+
label: Python Version
48+
description: >
49+
Please provide the installed version of Python.
50+
validations:
51+
required: true
52+
- type: textarea
53+
id: logs
54+
attributes:
55+
label: Installation Logs
56+
description: >
57+
If possible, please copy and paste the installation logs when attempting to install pandas.
58+
value: >
59+
<details>
60+
61+
62+
Replace this line with the installation logs.
63+
64+
65+
</details>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Performance Issue
2+
description: Report slow performance or memory issues when running pandas code
3+
title: "PERF: "
4+
labels: [Performance, Needs Triage]
5+
6+
body:
7+
- type: checkboxes
8+
id: checks
9+
attributes:
10+
options:
11+
- label: >
12+
I have checked that this issue has not already been reported.
13+
required: true
14+
- label: >
15+
I have confirmed this issue exists on the
16+
[latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
17+
required: true
18+
- label: >
19+
I have confirmed this issue exists on the master branch of pandas.
20+
- type: textarea
21+
id: example
22+
attributes:
23+
label: Reproducible Example
24+
description: >
25+
Please provide a minimal, copy-pastable example that quantifies
26+
[slow runtime](https://docs.python.org/3/library/timeit.html) or
27+
[memory](https://pypi.org/project/memory-profiler/) issues.
28+
validations:
29+
required: true
30+
- type: textarea
31+
id: version
32+
attributes:
33+
label: Installed Versions
34+
description: >
35+
Please paste the output of ``pd.show_versions()``
36+
value: >
37+
<details>
38+
39+
40+
Replace this line with the output of pd.show_versions()
41+
42+
43+
</details>
44+
validations:
45+
required: true
46+
- type: textarea
47+
id: prior-performance
48+
attributes:
49+
label: Prior Performance
50+
description: >
51+
If applicable, please provide the prior version of pandas and output
52+
of the same reproducible example where the performance issue did not exist.

doc/source/reference/series.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ strings and apply several methods to it. These can be accessed like
427427
Series.str.normalize
428428
Series.str.pad
429429
Series.str.partition
430+
Series.str.removeprefix
431+
Series.str.removesuffix
430432
Series.str.repeat
431433
Series.str.replace
432434
Series.str.rfind

doc/source/user_guide/text.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,19 @@ regular expression object will raise a ``ValueError``.
335335
---------------------------------------------------------------------------
336336
ValueError: case and flags cannot be set when pat is a compiled regex
337337

338+
``removeprefix`` and ``removesuffix`` have the same effect as ``str.removeprefix`` and ``str.removesuffix`` added in Python 3.9
339+
<https://docs.python.org/3/library/stdtypes.html#str.removeprefix>`__:
340+
341+
.. versionadded:: 1.4.0
342+
343+
.. ipython:: python
344+
345+
s = pd.Series(["str_foo", "str_bar", "no_prefix"])
346+
s.str.removeprefix("str_")
347+
348+
s = pd.Series(["foo_str", "bar_str", "no_suffix"])
349+
s.str.removesuffix("_str")
350+
338351
.. _text.concatenate:
339352

340353
Concatenation
@@ -742,6 +755,8 @@ Method summary
742755
:meth:`~Series.str.get_dummies`;Split strings on the delimiter returning DataFrame of dummy variables
743756
:meth:`~Series.str.contains`;Return boolean array if each string contains pattern/regex
744757
:meth:`~Series.str.replace`;Replace occurrences of pattern/regex/string with some other string or the return value of a callable given the occurrence
758+
:meth:`~Series.str.removeprefix`;Remove prefix from string, i.e. only remove if string starts with prefix.
759+
:meth:`~Series.str.removesuffix`;Remove suffix from string, i.e. only remove if string ends with suffix.
745760
:meth:`~Series.str.repeat`;Duplicate values (``s.str.repeat(3)`` equivalent to ``x * 3``)
746761
:meth:`~Series.str.pad`;"Add whitespace to left, right, or both sides of strings"
747762
:meth:`~Series.str.center`;Equivalent to ``str.center``

doc/source/whatsnew/v1.3.2.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Fixed regressions
2626
- Fixed regression in :func:`concat` where ``copy=False`` was not honored in ``axis=1`` Series concatenation (:issue:`42501`)
2727
- Regression in :meth:`Series.nlargest` and :meth:`Series.nsmallest` with nullable integer or float dtype (:issue:`42816`)
2828
- Fixed regression in :meth:`Series.quantile` with :class:`Int64Dtype` (:issue:`42626`)
29+
- Fixed regression in :meth:`Series.groupby` and :meth:`DataFrame.groupby` where supplying the ``by`` argument with a Series named with a tuple would incorrectly raise (:issue:`42731`)
2930

3031
.. ---------------------------------------------------------------------------
3132

doc/source/whatsnew/v1.3.3.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ Fixed regressions
1717
- Fixed regression in :class:`DataFrame` constructor failing to broadcast for defined :class:`Index` and len one list of :class:`Timestamp` (:issue:`42810`)
1818
- Performance regression in :meth:`core.window.ewm.ExponentialMovingWindow.mean` (:issue:`42333`)
1919
- Fixed regression in :meth:`.GroupBy.agg` incorrectly raising in some cases (:issue:`42390`)
20+
- Fixed regression in :meth:`.GroupBy.apply` where ``nan`` values were dropped even with ``dropna=False`` (:issue:`43205`)
2021
- Fixed regression in :meth:`.GroupBy.quantile` which was failing with ``pandas.NA`` (:issue:`42849`)
2122
- Fixed regression in :meth:`merge` where ``on`` columns with ``ExtensionDtype`` or ``bool`` data types were cast to ``object`` in ``right`` and ``outer`` merge (:issue:`40073`)
2223
- Fixed regression in :meth:`RangeIndex.where` and :meth:`RangeIndex.putmask` raising ``AssertionError`` when result did not represent a :class:`RangeIndex` (:issue:`43240`)
2324
- Fixed regression in :meth:`read_parquet` where the ``fastparquet`` engine would not work properly with fastparquet 0.7.0 (:issue:`43075`)
2425
- Fixed regression in :func:`is_list_like` where objects with ``__iter__`` set to ``None`` would be identified as iterable (:issue:`43373`)
26+
- Fixed regression in :meth:`.Resampler.aggregate` when used after column selection would raise if ``func`` is a list of aggregation functions (:issue:`42905`)
27+
- Fixed regression in :meth:`DataFrame.corr` where Kendall correlation would produce incorrect results for columns with repeated values (:issue:`43401`)
2528

2629
.. ---------------------------------------------------------------------------
2730

doc/source/whatsnew/v1.4.0.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Styler
7878
- :meth:`.Styler.to_html` introduces keyword arguments ``sparse_index``, ``sparse_columns``, ``bold_headers``, ``caption`` (:issue:`41946`, :issue:`43149`).
7979
- Keyword arguments ``level`` and ``names`` added to :meth:`.Styler.hide_index` and :meth:`.Styler.hide_columns` for additional control of visibility of MultiIndexes and index names (:issue:`25475`, :issue:`43404`, :issue:`43346`)
8080
- Global options have been extended to configure default ``Styler`` properties including formatting and encoding and mathjax options and LaTeX (:issue:`41395`)
81+
- Naive sparsification is now possible for LaTeX without the multirow package (:issue:`43369`)
8182

8283
Formerly Styler relied on ``display.html.use_mathjax``, which has now been replaced by ``styler.html.mathjax``.
8384

@@ -104,6 +105,7 @@ Other enhancements
104105
- :meth:`.GroupBy.cummin` and :meth:`.GroupBy.cummax` now support the argument ``skipna`` (:issue:`34047`)
105106
- :meth:`read_table` now supports the argument ``storage_options`` (:issue:`39167`)
106107
- Methods that relied on hashmap based algos such as :meth:`DataFrameGroupBy.value_counts`, :meth:`DataFrameGroupBy.count` and :func:`factorize` ignored imaginary component for complex numbers (:issue:`17927`)
108+
- Add :meth:`Series.str.removeprefix` and :meth:`Series.str.removesuffix` introduced in Python 3.9 to remove pre-/suffixes from string-type :class:`Series` (:issue:`36944`)
107109

108110
.. ---------------------------------------------------------------------------
109111
@@ -291,7 +293,7 @@ Performance improvements
291293
- Performance improvement in :func:`read_stata` (:issue:`43059`)
292294
- Performance improvement in :meth:`to_datetime` with ``uint`` dtypes (:issue:`42606`)
293295
- Performance improvement in :meth:`Series.sparse.to_coo` (:issue:`42880`)
294-
-
296+
- Performance improvement in indexing with a :class:`MultiIndex` indexer on another :class:`MultiIndex` (:issue:43370`)
295297

296298
.. ---------------------------------------------------------------------------
297299
@@ -384,7 +386,7 @@ I/O
384386
- Bug in :func:`Series.to_json` and :func:`DataFrame.to_json` where some attributes were skipped when serialising plain Python objects to JSON (:issue:`42768`, :issue:`33043`)
385387
- Column headers are dropped when constructing a :class:`DataFrame` from a sqlalchemy's ``Row`` object (:issue:`40682`)
386388
- Bug in unpickling a :class:`Index` with object dtype incorrectly inferring numeric dtypes (:issue:`43188`)
387-
-
389+
- Bug in :func:`read_csv` where reading multi-header input with unequal lengths incorrectly raising uncontrolled ``IndexError`` (:issue:`43102`)
388390

389391
Period
390392
^^^^^^
@@ -408,6 +410,8 @@ Groupby/resample/rolling
408410
- Bug in :meth:`pandas.DataFrame.rolling` operation along rows (``axis=1``) incorrectly omits columns containing ``float16`` and ``float32`` (:issue:`41779`)
409411
- Bug in :meth:`Resampler.aggregate` did not allow the use of Named Aggregation (:issue:`32803`)
410412
- Bug in :meth:`Series.rolling` when the :class:`Series` ``dtype`` was ``Int64`` (:issue:`43016`)
413+
- Bug in :meth:`DataFrame.rolling.corr` when the :class:`DataFrame` columns was a :class:`MultiIndex` (:issue:`21157`)
414+
- Bug in :meth:`DataFrame.groupby.rolling` when specifying ``on`` and calling ``__getitem__`` would subsequently return incorrect results (:issue:`43355`)
411415

412416
Reshaping
413417
^^^^^^^^^

0 commit comments

Comments
 (0)