BrandonFors/pandas-github-issues huggingface dataset:
DOC: Improve DateOffset docstring with constructor and examples (#52431)
State: closed

Updates the docstring for the `DateOffset` class in `offsets.pyx`.

Changes:
- Added a constructor signature and parameter documentation

This addresses part of issue #52431 (documentation improvements for offset constructors).

Labels:
name: Docs
name: Frequency
description: DateOffsets
name: Stale

Comments:
Thanks for the contribution @ericzhihuang, but I don't understand the changes here. This docstring already has examples and see also sections, you are adding new ones in the middle of the description.

Can you have a look, make sure that the docstring makes sense as a whole, and also check that the CI is happy. I guess it's red because the errors mentioned.
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.
DOC: Restructure and expand UDF page
State: closed

I changed the order in which the methods are presented,both in the table and in the sections, to be:

- map
- apply
- pipe
- filter
- agg
- transform

I find it easier to explain them in this order.

And I expanded the method sections with examples and a bit more of information.

I removed the most complex example in the intro, as I think the examples in the sections will make a better job now at explaining the most complex cases.

@arthurlw @rhshadrach do you mind having a look?

Labels:
name: Docs
name: Apply
description: Apply, Aggregate, Transform, Map

Comments:
Looks good to me! I think the example under vectorized operations should be changed to fit with the Fahrenheit example, but that can be added in a follow-up PR.
Thanks @arthurlw, great feedback. I'll leave the example on the vectorized section for now, as it may make sense to also expand that section as we make progress with the IT engines. Feel free to update it now if you want, but I'm unsure at this point how to add the JIT engines to that section, and how to better present all the performance related topics. Maybe we can just add a section for it, but maybe we can find a way to present it so one topic expands on the previous, as I tried to do with the different methods. 
Merging here, as I want to add few more things to this page. Please let me know if any comment, happy to address feedback in a follow up PR.
ENH: Implement PDEP-17
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.

Continuation of #58169

Still needs tests and some cleanup with the docs and decorator arguments, but I'd like to get a first look.

cc @Dr-Irv @Aloqeely 

Labels:
name: Enhancement
name: Warnings
description: Warnings that appear or should be added to pandas

Comments:
Seems like the label `PDEP` can only be used for the PDEP themselves. Otherwise building the website fails, as it expects the PR to be a PDEP that needs to be rendered in the roadmap.
@Dr-Irv - Thanks for the review! I'm negative on the name `PandasWarning` for a class that has to do with deprecations. pandas emits many warnings, not all are about deprecations.
> @Dr-Irv - Thanks for the review! I'm negative on the name `PandasWarning` for a class that has to do with deprecations. pandas emits many warnings, not all are about deprecations.

Maybe a different name would solve that?  Maybe `PandasDeprecationOrFutureWarning` or something like that.

> Maybe a different name would solve that? Maybe `PandasDeprecationOrFutureWarning` or something like that.

Currently using `PandasChangeWarning`, which has my personal preference so far. Always open to other options or opinions!
> I think there should be separate docs about the deprecation policy and these classes, aside from what is in the whatsnew document.

I've added some implementation details to PDEP-17, and more details to the whatsnew. If you'd like to see this documented somewhere else, can you detail where.
@bashtage - pandas_datareader is using the `deprecate_kwarg` decorator. I'm modifying it here, is this an issue?
@mroeschke - this should be ready.
> Can you think of a linting rule that could remind us to use these new warning classes instead of FutureWarning and DeprecationWarning?

I think we can raise in `tm.assert_produces_warning` whenever a straight Future/Deprecation/PendingDeprecationWarning is passed. However we cannot do this at the moment as there are a bunch of FutureWarnings that need to be enforced for pandas 3.0.

My suggestion would be to move forward here, enforce pandas 3.0 deprecations, and revisit adding such logic to `tm.assert_produces_warning`. I don't doubt there will be adding warnings that need to be converted at that point, happy to take up that work.
I can only build the docs in this PR if I specify `--num-jobs=1` and cannot reproduce this locally.
@mroeschke - okay to merge?
Thanks @rhshadrach
BUG: Raise ValueError on integer indexers containing NA; skip test for unsupported EAs(#56727)
State: open

- [x] closes #56727 
- [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.

What this PR changes:

- Adds a check to _setitem_with_indexer to raise a ValueError when NA is present in the indexer.

- Updates test_setitem_integer_with_missing_raises to skip test cases for known ExtensionArray types (PeriodArray, DatetimeArray, IntervalArray) that do not support indexing with NA in integer indexers.

Labels:
name: Bug
name: Testing
description: pandas testing functions or related to the test suite
name: ExtensionArray
description: Extending pandas with custom dtypes or arrays.
name: Stale

Comments:
Greetings! I’m following up on this PR.
If there’s any input or revisions required, please feel free to let me know.
Thank you!
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.
Wheels for win_arm64
State: closed

- [ ] closes #61462
- [x] no new code was added to pandas

Labels:
name: Build
description: Library building on various platforms

Comments:
Regular win_amd also required the `pip install delvewheel` for some reason, despite the fact I didn't touched it. Added that for all win plats to fix the build.
Thanks @khmyznikov 
@mroeschke any ETA when the new version will be available on PyPi?
> any ETA when the new version will be available on PyPi?

Probably Q4 2025 when pandas 3.0 is anticipated to be released
DOC: change `pandas.DataFrame.unstack`'s `fill_value` param to scalar
State: closed

- [x] closes #61445 (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.

<img width="796" alt="image" src="https://github.com/user-attachments/assets/2540c012-dc39-47bd-81f9-263855a2c69d" />


Labels:
name: Docs

Comments:
Thanks @KevsterAmp
ENH: Added `DataFrame.nsorted` to select top ``n`` rows according to column-dependent order
State: open

- [x] closes #61166 
- [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.

PR is ready for review.


Labels:
name: Stale

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.
The PR has been waiting for reviewers since then.
@rhshadrach @snitish @Dr-Irv 
I applied the comments and the checks passed, so the PR should be ready for re-review.
fix(doc): #61432 typing
State: closed

- [x] closes #61432
- [ ] [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: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
@mroeschke thank you for the approval. Wouldn't the PR fit for 2.2.4 or 2.3.0? It seems to be merely a fix to me.
This PR will go into 3.0. No whatsnew entry is needed for this PR.
Thanks @cmp0xff
BUG: Raise TypeError when joining with non-DataFrame using 'on=' (GH#61434)
State: open

Closes GH#61434

### What does this PR change?

When using `DataFrame.join()` with the `on` parameter, passing an invalid object like a `dict`, `int`, or third-party DataFrame previously resulted in unclear internal errors.

This PR adds a minimal type check that raises a clear `TypeError` when `other` is not a `DataFrame`, `Series`, or a list of such objects. Valid list-based joins without `on` remain unaffected.

### Checklist

- [x] Closes #61434
- [x] Tests added and passed
- [x] All code checks passed via `pre-commit run --all-files`
- [x] Entry added in `doc/source/whatsnew/v3.0.0.rst`

Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Error Reporting
description: Incorrect or improved errors from pandas
name: Stale

Comments:
All checks passed except the Pyodide build, which failed due to a rate-limit (HTTP 429). The failure seems unrelated to this PR. A rerun should resolve it
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.
@mroeschke @rhshadrach can you please take a look at this?
TYP: Update typing for 3.10
State: closed

- Ran `pyupgrade` so that typing is updated to python 3.10 - that modified files in `pandas/_libs`
- Updated `pandas/_typing.py` to have the following:
  - Use `TypeAlias` to declare all types
  - Change `Type` to use `builtins.type`
  - Remove `Optional`
  - Remove use of `Union` *except* for when it is used on a pandas type

Also fixed some other typing issues as well as an issue with running `stubtest` locally.


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

Comments:
Thanks @Dr-Irv
BUG: Fix DataFrame constructor misclassification of array-like with 'name' attribute (#61443)
State: closed

BUG: Fix DataFrame constructor misclassification of array-like with 'name' attribute

Previously, any object with a `.name` attribute (like some `vtkArray`-like objects) was assumed to be a `Series` or `Index`, causing the DataFrame constructor to misinterpret the input and raise errors when passed valid 2D array-likes.

This fix ensures we only apply the named-Series/Index logic when the input is **actually** an instance of `ABCSeries` or `ABCIndex`, and the `name` is not `None`.

A new test was added to ensure array-like subclasses with `.name` are handled correctly.

---

- [x] Closes #61443
- [x] Tests added and passing
- [x] Code passes all checks via `pre-commit`
- [x] Behavior verified with array-like + `.name` case
- [x] Entry added in `doc/source/whatsnew/v3.0.0.rst`

Labels:
name: Bug
name: Constructors
description: Series/DataFrame/Index/pd.array Constructors

Comments:
**Note:** One unrelated pre-commit check failed:

 ```
Check for strings with misplaced spaces.................................................................Failed
 - hook id: unwanted-patterns-strings-with-misplaced-whitespace

 pandas/_libs/tslibs/offsets.pyx:5112: String has a space at the beginning instead of the end of the previous string.
 pandas/_libs/tslibs/offsets.pyx:5126: String has a space at the beginning instead of the end of the previous string.
 ```

 One of the flagged lines includes:

 ```python
 f" instead.",
 ```

 This has a space at the *start* of the string rather than the end of the previous one, which violates the `unwanted-patterns-strings-with-misplaced-whitespace` pre-commit rule.

 Since this file wasn't touched in this PR and is unrelated to the fix, I’ve left it as-is. Let me know if you'd like me to patch it.

> Thanks for the PR! Can you add a line in the whatsnew for 3.0 under the `Other` section in bugfixes.
> 
> >

Thanks for the review @rhshadrach!
Added the whatsnew entry and the GH#61443 comment in the test
Thanks @iabhi4
BUG: Fix Dataframe handling of scalar Timestamp #61444
State: closed

closes #61444
Tests developed, but validating against test suite to ensure full compliance.  Will update pull request with submission notes and unit test after validation this doesn't disrupt other functions.

TODO:
- [ ] 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: Stale
name: Timestamp
description: pd.Timestamp and associated methods

Comments:
Existing tests seem to be happy, what's needed is to add a test that fails now, and passes with the code changes here. As well as the release note.
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.
DOC: fix typo in merging.rst
State: closed

"order data"

- ~~[ ] 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 @wjandrea
BLD: Decrease size of docker image
State: closed

This PR reduces the size of the docker image by:
- combining RUN commands to minimise the number of layers 
- removing the apt lists files to reduce total size 
- use --no-cache-dir when installing with pip

In my tests it reduced the size of the final image with approximately 0.47GB (most of it due to the --no-cache-dir). 

- [ ] 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:

Comments:
Thanks @huisman
DOC: Updates to documentation - io.rst
State: closed

updating hdf5 data description link due to 404 error

- [x] closes #61428 
- [ ] [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 @ConnorWallace15
BUG: Fix memory leak when slicing Series and assigning to self
State: closed

This PR fixes a memory leak that occurs when a Series is sliced and reassigned to itself, e.g., a = a[-1:].

The underlying BlockManager retained references to the original data, preventing garbage collection. This is resolved by ensuring the sliced result copies the backing data.

Closes #60640.

Labels:

Comments:
Thanks for the PR, but this solution would be a non-starter as it introduces extra copies.

Since there's continuing discussion in the issue going to close this PR
BUG: Raise MergeError when suffixes result in duplicate column names …
State: closed

closes #61402 

 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: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
pre-commit.ci autofix
Thanks for your contribution!

Just a quick note: you don't need to write `GH#61402` in the PR description — simply using `#61402` in PR description, is enough, GitHub will automatically link it 😀. 
Also, since this PR addresses a bug, please make sure to:
* Add a unit test that covers this case
* Include an entry in the `doc/source/whatsnew/vx.y.z.rst` file to document your fix

For reference, you can check the contributing guidelines here: https://pandas.pydata.org/docs/development/contributing_codebase.html#documenting-your-code
Thanks for the pointers.  I'll get those added in here soon.  Trying to track down why the Unit Tests / Linux-32-bit(pull_request) is failing.  I didn't change anything that should have effected Series, so it's kinda weird.  

I also can't get the pytest to run normally on my dev yet either, so I haven't been able to fully replicate the failure locally yet.  So, still a little more work to do here.
@Farsidetfs I believe the CI failure is not related to your changes. It appears to be caused by the cython version — pandas unit tests fail with `cython==3.1.0`. You may notice that the same test failures have occurred in several recent PRs as well. I already address the issue in https://github.com/pandas-dev/pandas/pull/61423. 
pre-commit.ci autofix
pre-commit.ci autofix
pre-commit.ci autofix
pre-commit.ci autofix
@nikaltipar I think this should be ready now.  Please let me know if I've missed anything.  I took your advice and combined the two with slight modifications to improve efficiency using sets throughout rather than just convert at the end.
> @nikaltipar I think this should be ready now. Please let me know if I've missed anything. I took your advice and combined the two with slight modifications to improve efficiency using sets throughout rather than just convert at the end.

Thanks for taking care of that, @Farsidetfs ! It looks good to me, no other comments from my side. Thanks for adding the unit-tests, too!
@nikaltipar Could you rebase main branch to trigger CI again?
> @nikaltipar Could you rebase main branch to trigger CI again?

I am not able to, I'll have to wait for @Farsidetfs 
Rebase complete.  Thanks.  Let me know if there's anything else needed.
#61402 
@rhshadrach All requested changes are complete, so it should be ready for your review to unblock merge.  Thanks
@Farsidetfs - just a conflict that needs resolved in the whatsnew.
pre-commit.ci autofix
pre-commit.ci autofix
@rhshadrach Merge conflicts resolved, ready for merge
Thanks @Farsidetfs very nice
DOC: Updated titanic.rst survived description
State: closed

- [x] closes #61412
- [ ] ~[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:
Thanks @arthurlw
Bug fix slow plot with datetimeindex
State: closed

- [x] closes [#61398](https://github.com/pandas-dev/pandas/issues/61398)
- [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).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions. (N/A - no new methods/functions added)
- [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:
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.