BrandonFors/pandas-github-issues huggingface dataset:
Fixed BUG: Using NamedTuples with .iloc fails #48188
State: closed

- [ ] closes #48188 (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves

Comments:
Thanks @MkMayo for the PR. 

It appears there is already an open issue for fix this.
#57004
Thanks for the PR but as mentioned this is already being worked on in https://github.com/pandas-dev/pandas/pull/57004 so closing in favor of that PR. We can reopen this PR if that one becomes stale
Added `pyarrow` extra for instructions on silencing the `DeprecationWarning`
State: closed

Changes requested in https://github.com/pandas-dev/pandas/issues/54466#issuecomment-1930675430

Labels:
name: Dependencies
description: Required and optional dependencies
name: Warnings
description: Warnings that appear or should be added to pandas

Comments:
Sorry I missed this, but this was addressed in https://github.com/pandas-dev/pandas/pull/57551. Thanks for the start here but closing
Sound good @mroeschke . It would be nice to update the messages in the `DeprecationWarning` to mention this extra too, feel free to diff this PR with your PR to see what I had posed
The warning will be removed in 2.2.1 https://github.com/pandas-dev/pandas/pull/57556
Translate more banned import config to ruff
State: closed

Translate some config in `unwanted-patterns-in-tests` to `ruff`. I think the main selling point of `ruff` here is just the ease of implementing new rules, like the currently unenabled `pytest.warns` one.

The major difference is that `unwanted-patterns-in-tests` is currently only enabled in `pandas/tests` while with this implementation, `TID251` will be enabled globally. 

There are several approaches we can explore to reconcile the 2 behaviors. 
- Keep it globally enabled for rule where the number of errors is low (and keep using `pygrep`) for the rest
- Use [hierarchical configuration](https://docs.astral.sh/ruff/configuration/#pyprojecttoml-discovery) (I think `pandas` doesn't use it at the moment, so this will be a fairly big change)

There's an open issue to track the progress of [flat configuration](https://github.com/astral-sh/ruff/issues/7696), which allows us to keep all rules within 1 config file, but there's not much progress lately.

Labels:
name: Code Style
description: Code style, linting, code_checks

Comments:
Thanks @tqa236
Use ruff to enforce import alias
State: closed

I replaced the hook `use-pd_array-in-core` with `ruff`'s [`unconventional-import-alias`](https://docs.astral.sh/ruff/rules/unconventional-import-alias/)

The `pre-commit` job will fail to show that the check works. It will pass after I enable `exclude: ^pandas/core/api\.py$`.

If this change is accepted, I can continue with removing the old hook.

As far as I can understand, a major difference is that `scripts/use_pd_array_in_core.py` tries to detect all variants of `pd.<insert anything here>.array` while we must explicitly pass the full path for `ruff` (there's only `pandas.core.construction.array`). 

Labels:
name: Code Style
description: Code style, linting, code_checks

Comments:
Looks pretty good. Could you address the pre-commit failure?
@mroeschke I fixed the config and removed the old hook. `pre-commit` passes now. The failed pipelines seem unrelated to this PR.
Thanks @tqa236
DEPR: disallow parsing datetimes with mixed time zones unless `utc=True`
State: closed

xref #54014

enforced deprecation disallowing parsing datetimes with mixed time zones unless user passes `utc=True` to `to_datetime`

Labels:
name: Datetime
description: Datetime data dtype
name: Deprecate
description: Functionality to remove in pandas

Comments:
@MarcoGorelli, could you please take a look at this PR?
Thanks @natmokval
PERF: reindex default fill_value dtype
State: closed

- [ ] closes #45857 (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
thx @mroeschke
CoW: Remove cow branches from more tests
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Copy / view semantics

Comments:
Thanks @phofl
CoW: Finish deprecation enforcal on block level
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Copy / view semantics

Comments:
Thanks @phofl
[pre-commit.ci] pre-commit autoupdate
State: closed

<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.6 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.6...v0.2.0)
- [github.com/pylint-dev/pylint: v3.0.1 → v3.0.3](https://github.com/pylint-dev/pylint/compare/v3.0.1...v3.0.3)
- [github.com/PyCQA/isort: 5.12.0 → 5.13.2](https://github.com/PyCQA/isort/compare/5.12.0...5.13.2)
<!--pre-commit.ci end-->

Labels:

Comments:
Since https://github.com/pandas-dev/pandas/pull/57182 is bumping ruff and the other updates seem minor, closing in favor of that PR
DOC: fix PR02 errors in docstrings of Index subclasses
State: closed

To fix PR02 errors, this PR adds `__signature__` to the methods, so that the docs show the correct signature instead of `*args, **kwargs`.

- [x] xref #57111(Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Docs

Comments:
Thanks @yuanx749 
Awesome!! Thank you
CoW: Enforce some deprecations on the datafame level
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Got most usages on the frame/series level

Labels:
name: Copy / view semantics

Comments:
this should take care of the failures
Thanks @phofl
PERF: RangeIndex.append with the same index
State: closed

```python
In [1]: import pandas as pd, numpy as np

In [2]: idx = pd.RangeIndex(1000)

In [3]: %timeit idx.append([idx] * 100_000)
362 ms ± 4.39 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  # main
342 ms ± 4.07 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  # pr
```

Labels:
name: Performance
description: Memory or execution speed performance
name: Index
description: Related to the Index class or subclasses

Comments:
thx @mroeschke
REGR/DOC: pd.concat should special case DatetimeIndex to sort even when sort=False
State: closed

- [x] closes #57006
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/v2.2.1.rst` file if fixing a bug or adding a new feature.

Reverts the changes from #54769 due to long-standing behavior and documents the behavior instead.

See discussion regarding the inconsistency of the long-standing behavior here: https://github.com/pandas-dev/pandas/issues/57006#issuecomment-1913562404

Labels:
name: Docs
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Regression
description: Functionality that used to work in a prior pandas version

Comments:
thx @lukemanley 
IMO I think this case should still be deprecated. Carve-outs like this ultimately lead to confusion
> IMO I think this case should still be deprecated. Carve-outs like this ultimately lead to confusion

I opened https://github.com/pandas-dev/pandas/issues/57335 for discussion.
Update type hint in io/formats/format.py
State: closed

The brackets around the type hint broke the libcst parser. Since the brackets are not necessary for the type hint, they have been removed

- [x] closes #57248
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Typing
description: type annotations, mypy/pyright type checking

Comments:
@twoertwein i've milestoned 3.0 since we normally don't backport typing changes and the problem code has not been modified recently but if the superfluous parenthesis breaks things feel feel to change to 2.2.1 as it would probably do no harm.
Thank you @FrostMegaByte!

I'm with you, @simonjayhawkins, on not backporting (it doesn't impact major typecheckers and seems more like a libcst issue), but I have no strong opinion.
Fix errors in docstring for `pandas.PeriodIndex`
State: closed

Fix errors in `pandas.PeriodIndex`.
While working on it, I also add docstrings to the two associated new methods.

- [x] xref #57111(Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Docs
name: Period
description: Period data type

Comments:
Thanks @yuanx749
DEPR: Remove first and last from DataFrame
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

xref #53710

Labels:
name: Deprecate
description: Functionality to remove in pandas
name: DataFrame
description: DataFrame data structure

Comments:
Thanks @phofl 
@rhshadrach you can’t add the deprecation label, otherwise the bot will pick it up 

we would have to add a new label if we want to group the enforcals somehow
Ah - thanks
DOC: fix PR02 errors in docstring for pandas.core.groupby.DataFrameGroupBy.corrwith
State: closed

All PR02 Errors resolved in the following cases:

1. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.core.groupby.DataFrameGroupBy.corrwith
2. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.DataFrame.corrwith               

OUTPUT:

1. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.core.groupby.DataFrameGroupBy.corrwith
```
################################################################################
################################## Validation ##################################
################################################################################

Docstring for "pandas.core.groupby.DataFrameGroupBy.corrwith" correct. :)
```

2. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.DataFrame.corrwith    
```
################################################################################
################################## Validation ##################################
################################################################################

Docstring for "pandas.DataFrame.corrwith" correct. :)
```           


- [x] xref https://github.com/pandas-dev/pandas/issues/57111
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Docs
name: Groupby

Comments:
@mroeschke can you take a look at this PR when you get a chance? 
Thanks keep em coming!
DOC: Fix typo in merging.rst
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Docs

Comments:
Thanks @thadguidry
DOC: fix PR02 errors in docstring for pandas.Series.rename_axis
State: closed

All PR02 Errors resolved in the following cases:

1. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.Series.rename_axis
2. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.DataFrame.rename_axis

OUTPUT:

1. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.Series.rename_axis
```
################################################################################
################################## Validation ##################################
################################################################################

1 Errors found for `pandas.Series.rename_axis`:
	ES01	No extended summary found
```

2. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.DataFrame.rename_axis
```
################################################################################
################################## Validation ##################################
################################################################################

1 Errors found for `pandas.DataFrame.rename_axis`:
	ES01	No extended summary found
```


- [x] xref https://github.com/pandas-dev/pandas/issues/57111
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Docs

Comments:
@mroeschke I've pushed a fix for your suggested improvements, can you take another look?
Thanks @jordan-d-murphy
Remove Copy-on-Write builds
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: CI
description: Continuous Integration
name: Copy / view semantics

Comments:
Thanks @phofl
Remove Copy-on-Write warning mode from tests
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Copy / view semantics

Comments:
Thanks @phofl
DOC: Clarifying brackets vs. parentheses
State: closed

- [x] closes #56972
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit). (Doc edits only)
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions. (Doc edits only)
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature. (Doc edits only)

In addition to the clarification requested in #56972, I adjusted the language where square brackets were specified elsewhere in the documentation to match "square brackets ``[]``", with the exception of one file.

In the data subsetting tutorial guide (`doc/source/getting_started/intro_tutorials/03_subset_data.rst`),  square brackets are specified towards the beginning of the guide, and "selection brackets" was used elsewhere, often to specify outer vs. inner square brackets (i.e. `df[['ColA', 'ColB']]`)

Labels:
name: Docs

Comments:
Thanks @noah-asing!
DOC: Updated docstring for set_option
State: closed

- [X] closes #57148
- [X] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).


Labels:
name: Docs

Comments:
Also related: https://github.com/pandas-dev/pandas/issues/57111
pre-commit.ci autofix
Thanks @jrmylow
REGR: Fix to_numpy conversion for arrow ea with float dtype given
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

xref #57121

Labels:
name: Arrow
description: pyarrow functionality

Comments:
This should fix #57093 as well. 

I started something similar in #57170. Do you want to copy the test from #57170 into this PR and I'll close mine?

you might also want to include the `NaT` cases I have in #57170 as it will fix this which currently raises:

```
import pandas as pd

ser = pd.Series([1, None], dtype='Int64')
ser.astype("m8[ns]")
```
Does this address https://github.com/pandas-dev/pandas/pull/57233#issuecomment-1925737224 as well?
Yikes I missed that comment, will follow up
REGR: to_json converting nullable ints to floats
State: closed

- [ ] closes #57224 (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Regression
description: Functionality that used to work in a prior pandas version
name: IO JSON
description: read_json, to_json, json_normalize

Comments:
Thanks @phofl