BrandonFors/pandas-github-issues huggingface dataset:
DEPR: GroupBy.quantile with bool dtype
State: closed

- [x] closes #51424 (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.
- [ ] 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: Groupby
name: Deprecate
description: Functionality to remove in pandas
name: quantile
description: quantile method

Comments:
Thanks @jbrockmendel
DEPR: Replacing builtin and NumPy funcs in agg/apply/transform
State: closed

- [x] closes #53425 (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: Deprecate
description: Functionality to remove in pandas
name: Apply
description: Apply, Aggregate, Transform, Map

Comments:
Thanks @rhshadrach
DOC: Added note for `corr` 
State: closed

- [ ] closes #49939 
- [ ] 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.

Labels:
name: Docs

Comments:
@MarcoGorelli please review this when possible.
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/53972/
just waiting for the preview to load, then I'll check that the rendered docs look alright, then hopefully we can merge
Sure @MarcoGorelli 

I tried building this page using 
`python make.py --single pandas.Series.corr`
But that doesn't seem to build this page. Can you please guide me on what I am missing? @MarcoGorelli 
don't know, can you check the contributing guide for documentation please?
@MarcoGorelli can you please check the docs?
Support uncertainties as EA Dtype
State: closed

In parallel with Pint and Pint-Pandas, changes to support uncertainties as an EA Dtype.

See https://github.com/hgrecco/pint/pull/1615
and https://github.com/hgrecco/pint-pandas/pull/140

- [ ] 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
- [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:

Comments:
IIUC the problem here is isna not recognizing your custom scalar?  I think the way to address this is directly in #27462/#27825

My last attempt at an implementation was #51378, which I still think is the way to go.
Please consider adding the https://github.com/pandas-dev/pandas/milestone/103 label to this pull-request.  There should be no user-visible changes.  The 2.1 milestone contains several enhancements that would further enhance the development versions of Pint and Pint-Pandas which await the changes from this pull request (see https://github.com/hgrecco/pint/pull/1615 and https://github.com/hgrecco/pint-pandas/pull/140).
Looks like we now depend on https://github.com/pandas-dev/pandas/pull/54110 for CI/CD to pass (which is not yet merged).
I also don't understand this complaint from `pylint`:

```
pylint...................................................................Failed
- hook id: pylint
- duration: 793.25s
- exit code: 4

************* Module pandas.tests.extension.json.test_json
pandas/tests/extension/json/test_json.py:[359](https://github.com/pandas-dev/pandas/actions/runs/5553184370/jobs/10141428866?pr=53970#step:12:364):4: W0246: Useless parent or super() delegation in method 'test_groupby_agg_extension' (useless-parent-delegation)
```

The code I un-commented was original code, and it appears to follow precisely the pattern of all other code in the module.  I'm at a loss as to how to proceed because I didn't create the `TestGroupby` class hierarchy and don't know why this particular case is getting singled out.
> The code I un-commented was original code

Again, just remove it and the parent class test will run.
> > The code I un-commented was original code
> 
> Again, just remove it and the parent class test will run.

Ah, now I understand.  I was afraid to remove a test that should be run, and did not grok that the test would run in the parent class.  I'll re-submit, waiting a few hours in case there's an answer to my pyarrow question.
This PR is obsolete now.
BUG: pd.replace changes dtype when using a dict to replace values even when there are no matches
State: closed

- [x] closes #53539 (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:

Comments:
I might be missing something here, so thought I'd ask before changing tests. The solution I found is to convert the dtypes of the resulting dataframe after the replace operation back to the original if no replacement was made. For inplace operations, `self` is overridden when `new_data` is generated, meaning in order to retain a copy of the original dataframe, I have to copy it before that operation takes place. I then use the copy of the original dataframe to check if no replacements where made and update the dtypes. This, however, creates a new `result` dataframe before return, meaning the np.shares_memory tests for inplace operations start failing. Not sure if there's a different solution I'm missing or if these tests should be altered to accommodate this fix.
See comment in the issue, this is intended behavior 
Thanks but based on the discussion in https://github.com/pandas-dev/pandas/issues/53539 this is the intended behavior so closing
BUG: Changed function signature to replace args and kwargs
State: closed

- [ ] closes #53071
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests)
- [ ] 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: Groupby

Comments:
Changes look good, but are causing some uncaught warnings in the tests.
Getting this error: Is it safe to change the superclass definition? @rhshadrach 
`pandas/core/frame.py:11132: error: Signature of "cumsum" incompatible with supertype "NDFrame"  [override]
pandas/core/frame.py:11132: note:      Superclass:
pandas/core/frame.py:11132: note:          def cumsum(self, axis: Optional[Union[int, Literal['index', 'columns', 'rows']]] = ..., skipna: bool = ..., *args: Any, **kwargs: Any) -> Any
pandas/core/frame.py:11132: note:      Subclass:
pandas/core/frame.py:11132: note:          def cumsum(self, axis: Optional[Union[int, Literal['index', 'columns', 'rows']]] = ..., numeric_only: bool = ..., skipna: bool = ..., *args: Any, **kwargs: Any) -> Any`

Yes - you'll also need to change the signature in NDFrame as well.
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
applying dedup_names func
State: closed

- [ ] closes #50371 (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests)
- [ ] 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:

Comments:
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
BUG: JSON serialization with orient split fails roundtrip on MultiIndex
State: closed

- [ ] closes #50456 
- [ ] [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 an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:

Comments:
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
BUG: `interpolate` with fillna methods fail to fill across multiblocks
State: closed

- [ ] Closes #53898
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests)
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit)
- [x] Added an entry in the latest `doc/source/whatsnew/v2.1.0.rst` file


Labels:
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments:
Thanks @Charlie-XIAO
DOC: Added note and example for pyarrow storage
State: closed

- [x] closes #42664 
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Labels:

Comments:
I think we want to wait for the discussion in https://github.com/pandas-dev/pandas/issues/48469 to resolve to going to close for now. Happy to have your contributions on other issues
PERF: speed up data frame comparison when shape differs
State: closed

- [ ] closes #53945
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Speed up data frame (or series) comparison when shapes are different. A noticeable improvement is observed. The following scripts:
```
>>> import pandas as pd
>>> import time
>>> df = pd.DataFrame({1: range(1000), 2: range(1000)})
>>> other = pd.DataFrame({1: range(1001), 2: range(1001)})
>>> start = time.process_time()
>>> df.equals(other)
False
>>> print(time.process_time() - start)
```
gives `0.00019999999999997797` before changes and ` 0.003806999999999894` after.



Labels:
name: Performance
description: Memory or execution speed performance
name: Stale

Comments:
The underlying perf issue here is that DataManager.equals uses generators, which slows things down there. I'd prefer fixing that directly.

Did you encounter perf. improvements from this fix, outside of `equals` itself?
> gives 0.00019999999999997797 before changes and  0.003806999999999894 after.

is this a typo?  looks like "before" is faster
> The underlying perf issue here is that DataManager.equals uses generators, which slows things down there. I'd prefer fixing that directly.
> 
> Did you encounter perf. improvements from this fix, outside of `equals` itself?

I did not investigate further. I was trying to fix a corner case discussed in #53945. That said, as raised by @jbrockmendel in the issue, the check on the shape is already done.
> > gives 0.00019999999999997797 before changes and  0.003806999999999894 after.
> 
> is this a typo? looks like "before" is faster

Yes, it is a typo. Thanks for pointing out. That said, it is not rigorous, the evaluation should be done on a large sample of data frames with various dimensions. Following discussion in #53945, we can probably close this PR. 
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.
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
API: add `NaTType` and `NAType` to `pandas.api.typing`
State: closed

- [x] Closes #53934
- [x] *I assume that no tests are needed for this*
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit)
- [x] *I assume that no changelog entry is needed for this*


Labels:
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Typing
description: type annotations, mypy/pyright type checking

Comments:
Thanks @Charlie-XIAO
DOC: EX01 (part of ExtensionArray)
State: closed

- [x] Towards #37875

`ExtensionArray` is kind of tricky, I don't know what kind of example should we put here. Currently I'm providing some (not directly runnable) example implementation for each method. Alternatively we can provide a fully implemented example in `ExtensionArray`, and link to that example in each method. Please let me know if I should make any modification.


Labels:
name: Docs

Comments:
im skeptical of it being worthwhile to implement subclasses in docstrings like this
yeah might be better to just instantiate examples of EAs, and show an example of these methods being used on them?

like
```python
In [1]: pd.array([1, 2, 3]).nbytes
Out[1]: 27
```
Sure, I'll re-do this PR.
DEPR: downcast keyword in Index.fillna
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: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Deprecate
description: Functionality to remove in pandas

Comments:
Thanks @jbrockmendel
Updated read_excel docstring to match style guide formatting
State: closed

Fixes `read_excel()` docstring to match docstring formatting style guide:
- Issue: https://github.com/pandas-dev/pandas/issues/53674. 
- Style Guide: https://pandas.pydata.org/docs/development/contributing_docstring.html


Labels:
name: IO Excel
description: read_excel, to_excel

Comments:
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
PERF: ffill/bfill with non-numpy dtypes
State: closed

Implement ffill/bfill in terms of 'take', avoiding an object cast.

```
ser = pd.Series(range(10**5), dtype="int64[pyarrow]")
ser[5000] = pd.NA

%timeit ser.ffill()
609 µs ± 25.9 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)  # <- branch
5.49 ms ± 158 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)  # <- main
```

Some of the perf difference is likely due to no longer issuing a PerformanceWarning.

Labels:
name: Performance
description: Memory or execution speed performance

Comments:
thx @jbrockmendel
TST: Concatenating categorical datetime columns
State: closed

- [x] closes #39443
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests)
- [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:
Thanks @rsm-23
DOC: Fixing EX01 - Added examples
State: closed

- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Towards https://github.com/pandas-dev/pandas/issues/37875


Labels:
name: Docs

Comments:
No preview found for PR #53948. Did the docs build complete?
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/53948/
This last fail doesn't look like it's related to the example. 
Thank you
It looks green :)
CLN : Removed unnecessary numba-compat code
State: closed

- [x] closes ##50392 (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
- [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: Clean

Comments:
can you run the code checks please?
Yes, sure
I ran tests fro this individual file and everything seems fine.

![Screenshot_2023-05-28_17-10-26](https://github.com/pandas-dev/pandas/assets/115390367/d4b40a25-9a98-410a-aab2-9a99dad44cfe)

Then, I ran code checks for all files and it also seems to be working fine.

![Screenshot_2023-06-30_20-46-37](https://github.com/pandas-dev/pandas/assets/115390367/d5c818b4-a789-4465-b5f4-79a66ea58ddf)

it fails in CI, so I guess you didn't commit?
It was a insignificant change, it should pass CI now ig.
TST: add test with freq=2M to increase coverage of to_period
State: closed

xref #52064

added a test in pandas/tests/indexes/datetimes/methods/test_to_period.py, which covers cases `freq=“2M"` and `freq=MonthEnd(2)` for `to_period` from DatetimeIndex. The reason: existing tests were all for `"freq='M'"`, rather than for `"freq='2M'"`.

Labels:
name: Needs Tests
description: Unit test(s) needed to prevent regressions

Comments:
@MarcoGorelli, could you please take a look at this pr?
BUG: Timestamp origin takes no effect in resample for 'MS' frequency
State: closed

- [x] closes #53662
- [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 an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Frequency
description: DateOffsets
name: Resample
description: resample method

Comments:
It seems the `_get_timestamp_range_edges()` never accounted for the edge case involving a combination of a DateTimeLike  `origin` and a `freq`. 

The change adds a simple check to modify the way the range is set `( first - freq )` vs `( freq.rollback() )` depending on the inputs.  

This gives the behaviour you're after @MarcoGorelli and preserves all other functionality. 
Let me know if I'm missing anything. 
thanks for your pr - this looks a bit complex, but it's encouraging that tests pass - I'll check next week!
> thanks for your pr - this looks a bit complex, but it's encouraging that tests pass - I'll check next week!

Hey @MarcoGorelli just bumping this up. 
I'll need to switch approaches. My solution only covers cases where the origin is within the period specified. 
could always raise an error if it's not, we don't need to do 4-D gymnastics, the most important thing is that for the cases when the computation succeeds, it's correct
Alright @MarcoGorelli I updated what I was doing to be a bit more straightforward. 
Now when the origin is a timestamp it's taken into account when setting `timestamp_range_edges` during resampling. 
I also had to update a few test to account for the desired behavior. 



Looks like I also need to update the Docs with the new expected behavior 
> For tz-naive, this seems correct. Nice one!
> 
> I think we just need some extra care for the tz-aware case

Added a check on the equality of Daylight Savings Time via `dst`. All checks pass including your proposed edge case. 
I believe everything else is taken care of.  
thanks for updating - this looks close 💪 
Anything else you want to see here @MarcoGorelli? 
this is probably fine - will take a (hopefully final) look tomorrow
TST: Always close figures in plotting tests
State: closed

Now that the plotting tests are more-or-less isolated and testing one topic, we can use the `mpl_cleanup` autouse fixture to close all figures per test and remove the need for `tm.close`

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

Comments:
looks fine to me, though might be good to have someone who knows matplotlib better have a look
DOC: EX01 ({Categorical, Interval, Multi, Datetime, Timedelta}-Index)
State: closed

- [x] Towards #37875.

Also removing some items from `ci/code_checks.sh` that have already had examples on the main branch.

Labels:
name: Docs

Comments:
Thank you for your PR @Charlie-XIAO!

Some of items that you removed from the file `ci/code_checks.sh` thinking that they already have examples, should not be removed. Many methods share one (the same) docstring and it _looks_ like that.

For example `pandas.CategoricalIndex.codes` seems on the dev website as it had an example already. But the example is actually for `pandas.Categorical.codes`.  

I only checked a couple of methods that were removed. It would be great if you could double check the rest please. Thanks a lot, your help is very much appreciated. :-)  

@DeaMariaLeon Thanks for the reminder! I see what you mean, so those examples should be modified. Maybe I can just do them in this PR as well. I also need to run `scripts/validate_docstrings.py` since there is a decent number of errors.