BrandonFors/pandas-github-issues huggingface dataset:
PERF: resolution, is_normalized
State: closed

```
dti = pd.date_range("2016-01-01", periods=10_000)
dta = dti._data

In [4]: %timeit dta.is_normalized
354 µs ± 3.62 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)   # <- main
122 µs ± 2.71 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)  # <- PR

In [5]: %timeit dta.resolution
493 µs ± 4.86 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)  # <- main
258 µs ± 10.3 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)  # <- PR
```

Labels:
name: Datetime
description: Datetime data dtype
name: Performance
description: Memory or execution speed performance

Comments:
Thanks @jbrockmendel
DOC: Fixup CoW userguide
State: closed

- [ ] closes #56622 (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: Copy / view semantics

Comments:
Thanks @phofl
CoW: Enable CoW by default and remove warning build
State: closed

I'd prefer to go this way in enabling CoW. Having it on makes it easier to enforce the change step by step rather than doing it all at once.

Labels:
name: Copy / view semantics

Comments:
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
cc @mroeschke 

this should be green now and ready to merge hopefully. That allows us to move forward with the deprecations here
Just a merge conflict post ArrayManager merge. Feel free to merge after that
DOC: Minor fixups for 2.2.0 whatsnew
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:
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/56632/
thx @rhshadrach
added negative value support in pct_changes of generic.py
State: closed

closes #56618


Labels:

Comments:
Thanks for the PR. Few points:

1. We can't change the default behavior without a deprecation cycle here (and reading the comments of the issue, don't think the default needs to change either).
2. You'll need to add another argument/parameter to the `pct_change` method that indicates whether or not you want to take absolute value of the denominator (similar changes would be required in your tests as well)
@asishm-wk I am not able to figure out the issue with the failing check
Could you please help with the same

The error comes from mypy - if you click on the failed build.

> pandas/core/generic.py:12152: error: Unsupported left operand type for / ("Self")  [operator]
> pandas/core/generic.py:12152: note: Right operand is of type "Self | DataFrame"

Looks like you removed the type ignore comment when you made the changes (needs to be there in both the if and else statements).
I appreciate the PR but I am not sure it is worth expanding the API for this. 
Thanks for the PR but it is a bit too early to craft a solution to the issue as it's still being actively discussed. Going to close but we can reopen if it has more acceptance from the core developers
TYP: some return types from ruff
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: Typing
description: type annotations, mypy/pyright type checking

Comments:
Thanks @twoertwein
BUG: Add limit_area to EA ffill/bfill
State: closed

- [x] closes #41813 (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.

Follow up to #56531.

This is slightly complicated by the `EA.fillna` deprecation.

 - If `EA.fillna` is implemented, we raise whenever `limit_area` is not None
 - If `EA._pad_or_backfill` is implemented and does not have a `limit_area` arg, we raise when `limit_area` is not None

My plan is to introduce a deprecation in 3.1 whenever `_pad_or_backfill` gets called (regardless of whether `limit_area` is `None`) informing EA authors they need to add this argument. Assuming this is a good way to do, I'll open a tracking issue for this.

For dtypes where the corresponding `mask` is not used after filling (e.g. `NDArrayBackedExtensionArray`), this takes a shortcut by modifying mask prior to filling. Compared to implementing `limit_area` after filling, this saves 1 or 2 copies (depending on the EA) and extra computation, at the cost of making `mask` no longer necessarily represent NA values.

Labels:
name: Bug
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: ExtensionArray
description: Extending pandas with custom dtypes or arrays.

Comments:
Friendly ping @phofl @jbrockmendel 
thx @rhshadrach 
Opened #56729 to track the deprecation
CI: Fix deprecation warnings
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

Comments:
merging to get ci green
DEPR: Remove SettingWithCopyWarning
State: closed

🥳

We shouldn't merge before the actual release is out

**`_item_cache` removal**
closes #50547
closes #29411
closes #21391

**SettingWIthCopyWarning removal**
closes #18752
closes #9767
closes #14150
closes #16550
closes #17505
closes #38270
closes #39418
closes #39448
closes #41891
closes #45513
closes #50209
closes #55451

**Others Matt thinks**
closes #19102



Labels:
name: Copy / view semantics

Comments:
wow this kills giant hacks that i wrote from a while back!

+1000000
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
Could you see if this works?

https://github.com/pandas-dev/pandas/issues/44866
 > Could you see if this works?

https://github.com/pandas-dev/pandas/issues/44866

It works if you use it on a series but it will never work if you do

df["a"].foo = "something
df["a"].foo

because both df["a"] are different objects with CoW, so this can't work

We can close the issue though, the case doesn't make sense under CoW
This PR closed an issue I subscribed to (#9767), and I had no idea why and how until I found https://pandas.pydata.org/pdeps/0007-copy-on-write.html. Leaving this here for others.
BUG: Added raising when merging datetime columns with timedelta columns
State: closed

- [x] closes #56455
- [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.
- [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: Datetime
description: Datetime data dtype
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Timedelta
description: Timedelta data type

Comments:
thx @Huanghz2001
Backport PR #56595 on branch 2.2.x (TST/CLN: Inline seldom used fixture)
State: closed

Backport PR #56595: TST/CLN: Inline seldom used fixture

Labels:
name: Refactor
description: Internal refactoring of code
name: Testing
description: pandas testing functions or related to the test suite

Comments:
sorry wrong milestone, but shouldn't hurt to backport either way
BUG: Fix inconsistency when constructing a Series with large integers
State: closed

- [x] closes #56566
- [x] [Tests added and passed
- [x] All [code checks passed]
- [ ] 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:

Comments:
@phofl I used your fix on #50757 and modified a little for MaskedArray Since it is the same issue. Can you pls review  it before I write test cases?
always write tests first
> always write tests first

oh okay sure.. will do..
DEPR: the method is_anchored() for offsets
State: closed

- [x] closes #55388

deprecated the method `is_anchored()` for offsets classes: `Tick, Week, QuarterOffset, FY5253Mixin, BaseOffset`

Labels:
name: Frequency
description: DateOffsets
name: Deprecate
description: Functionality to remove in pandas

Comments:
in this PR `is_anchored()` is deprecated for offsets. @MarcoGorelli, could you please take a look at my PR?
nice! @jbrockmendel I think you'd suggested this, fancy taking a look?
I found some inconsistency in the behavior of the classes `BusinessHour` and `CustomBusinessHour`.
We always return `False` for `pd.offsets.Hour().is_anchored()` 
But unexpectedly I get `True` for 
```
pd.offsets.BusinessHour().is_anchored()
pd.offsets.CustomBusinessHour().is_anchored()
```
I am not sure, is it a bug?

And messages in the `FutureWarning` are different:
```
Hour.is_anchored is deprecated and will be removed in a future version, please use False instead.
BusinessHour.is_anchored is deprecated and will be removed in a future version, please use 'obj.n == 1' instead.
```

The reason is they are non-Tick subclasses.

Should we fix it before we deprecate is_anchored? What do you think, @jbrockmendel?
just for reference, here's the (only) use-case I found of `is_anchored` in the wild:

https://github.com/pastas/pastas/blob/dbe3275e012143605e3a162bfbb8ff0983d966e6/pastas/timeseries_utils.py#L160-L185

It wouldn't work for converting `'2W-Tue'` to `'14D'` though, so I'm not sure `is_anchored` is what they really wanted in the first place

I doubt anyone's using it for business hour / custom business hour - I think it's fine to just deprecate
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/56594/
thanks @MarcoGorelli for reviewing this PR
DOC: Move deprecation note
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.


just a reordering, not critical for the rc

Labels:
name: Docs

Comments:
Thanks @phofl
ENH: Update CFF with publication reference, Zenodo DOI, and other details
State: closed

Continuing in the spirit of #54241, this PR adds some further information to the CITATION.cff file, including a reference to [McKinney (2010)](https://doi.org/10.25080/Majora-92bf1922-00a), the DOI of the software itself ([10.5281/zenodo.3509134](https://doi.org/10.5281/zenodo.3509134)), a link to the [team page](https://pandas.pydata.org/about/team.html) on pandas' website, and a couple more keywords that bring this list into alignment with what the GitHub repository displays.

Labels:
name: Admin
description: Administrative tasks related to the pandas project

Comments:
Thanks @cgobat
ENH: support the Arrow PyCapsule Interface on pandas.DataFrame (export)
State: closed

See https://github.com/apache/arrow/issues/39195 for some context, and https://arrow.apache.org/docs/dev/format/CDataInterface/PyCapsuleInterface.html for the new Arrow specification.

For now this PR just implements the stream support on DataFrame (using pyarrow under the hood to do the actual conversion). We should also consider adding the array and schema protocol methods. 

We could add similar methods on Series, but that has less of an exact equivalent in Arrow terms (e.g. it would loose the index).

This PR also only implements exporting a pandas DataFrame through the protocol, not adding support to our constructors to consume (import) any object supporting the protocol.

Labels:
name: Arrow
description: pyarrow functionality

Comments:
Very cool. Is this ready for review or sitting in draft for futher development?
Whatever is here is already ready for review. 

As mentioned in the top post, we should also consider adding `__arrow_c_schema__` (because we don't have a custom schema object that can expose this, although DataFrame is of course not a schema object, so it's not exactly fitting)

I should probably also add some details about how the conversion is done (essentially the defaults of `pyarrow.Table.from_pandas`, at the moment, but for example we can document that this converts the Index into a column, except for RangeIndex)
merging then, as discussed
BUG: convert_dtypes raising when preserving object dtype
State: closed

- [ ] closes #56581 (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: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
Thanks @phofl
TST/CLN: Reuse top level fixtures instead of parametrizations
State: closed


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Clean

Comments:
Going to merge this in. Can follow up if needed
It seems that the changes in ExtensionArray tests done here break testing of EAs in downstream packages. Those do not have access to fixtures defined in pandas conftest.py and since this PR relies on them, it breaks. See this outcome of GeoPandas CI using the latest nightly https://github.com/bnaul/geopandas/actions/runs/7402184055/job/20139507247. 
Sorry for the breakage. I opened up a PR in geopandas to fix this https://github.com/geopandas/geopandas/pull/3121

Our distribution of ExtensionArray tests is still a big fragile; I see you had to define some additional fixtures previously that were in `pandas/conftest.py`
BUG: stack changes NA values in the index
State: closed

- [x] closes #56573 (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.

~Still needs a bit more testing (MultiIndex inputs).~

Labels:
name: Bug
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
thx @rhshadrach
support tuple in startswith/endswith for arrow strings
State: closed

- [x] closes #56579(Replace xxxx with the GitHub issue number)
- [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: Strings
description: String extension data type and string data
name: Arrow
description: pyarrow functionality

Comments:
thx @rohanjain101
Add test groupby complex numbers
State: closed

- [x] closes https://github.com/pandas-dev/pandas/issues/26475
- [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: Testing
description: pandas testing functions or related to the test suite

Comments:
@phofl
I can change the name of the function or place it elsewhere, lmk what you think
thx @aram-cinnamon
DEPR: keep_date_col, nested parse_dates in read_csv
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [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).
- [ ] 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: IO CSV
description: read_csv, to_csv
name: Deprecate
description: Functionality to remove in pandas

Comments:
Thanks @jbrockmendel 
What is the rationale for deprecating datetime parsing on combined columns? That's something I personally use a lot (CSV being what it is, date, time of day and timezone offset are often stored in separate columns), and I've not seen equivalent code examples that would achieve the same thing at parsing time.
> I've not seen equivalent code examples that would achieve the same thing at parsing time.

Internally pandas didn't do this at parsing time. `read_csv` would combine parsed columns and use `to_datetime` essentially with these options. You can achieve the equivalent by using `.str.cat` with `to_datetime`
@mroeschke: Using `to_datetime` is fine for a flat dataframe, but it gets [increasingly complicated](https://github.com/pandas-dev/pandas/issues/50601#issuecomment-1376293705) as indexes and multi-indexes get tossed into the mix. No longer being able to specify those things in the read_csv config so I don't need to think about these afterwards wouldn't be the end of the world, but it's an extra bit of boilerplate index manipulation for some very common situations that I don't currently need to think about, and may pose problems for inexperienced users.
TYP: simple return types from ruff
State: closed

Ruff has many "unsafe" autofixes for simple return types.

I hope to enable `--unsafe-fixes` (for only the type annotations) after a few PRs.


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

Comments:
Thanks @twoertwein 
Is it needed to add `-> None` to test functions? (generally our `test_..` test functions don't have any type annotations at all, I think?)
> Is it needed to add `-> None` to test functions? (generally our `test_..` test functions don't have any type annotations at all, I think?)

I think it would be good to exclude pandas/tests (and scripts/tests - happy to revert that) from these ruff fixes! I don't think it would add value for the tests (unless people prefer it for consistency).

However, manually adding annotations for tests can be valuable to selectively allow mypy to run on some tests to help with #45252. I believe most test files are completely ignored and unannotated functions are anyways skipped: so we could use `-> None` to run mypy on a subset of tests within a file.
Revert "DOC: Change core paths to api.typing in URLs (#55626)"
State: closed

This reverts commit 5c7d89db4583bfa8cf628235f4d566d104776278.

- [ ] 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.

Reverting this as we don't want to change the URLs twice, pending #55632. 

Labels:
name: Docs

Comments:
thx @rhshadrach