BrandonFors/pandas-github-issues huggingface dataset:
CLN: Expose arguments in DataFrame.query
State: closed

- [x] closes #61405 
- [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.
- [ ] 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
name: expressions
description: pd.eval, query

Comments:
Thanks @loicdiridollou - very nice!
DOC: removed none from docstring
State: closed

- [x] closes #61408
- [ ] ~[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: Algos
description: Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff

Comments:
Thanks @arthurlw
CI: Upgrade to ubuntu-24.04, install Python free threading from conda-forge
State: closed


Labels:
name: CI
description: Continuous Integration

Comments:
Seems like that the python-freethreading from conda-forge is not recognized as a valid Python, no idea why. But other than that this looks great, much cleaner.
Probably needs a bump of meson/meson-python.
submitted https://github.com/cython/cython/issues/6870 for the warning.
thanks @mroeschke 
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
git checkout 2.3.x
git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
git cherry-pick -x -m1 b2b2d04e419e44932d51017ececb5c3a86b15925
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
git commit -am 'Backport PR #61410: CI: Upgrade to ubuntu-24.04, install Python free threading from conda-forge'
```

4. Push to a named branch:

```
git push YOURFORK 2.3.x:auto-backport-of-pr-61410-on-2.3.x
```

5. Create a PR against branch 2.3.x, I would have named this PR:

> "Backport PR #61410 on branch 2.3.x (CI: Upgrade to ubuntu-24.04, install Python free threading from conda-forge)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the `Still Needs Manual Backport` label once the PR gets merged.

If these instructions are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                
The free threading stuff isn't on 2.3 so no need for backport
BLD: allow to build with non-MSVC compilers on Windows
State: closed

Always passing --vsenv to meson means pandas can't be built with gcc/clang
on Windows.

Instead add it to the cibuildwheel config so MSVC is still forced in CI
when building wheels, and in various places where it is built via pip.

Labels:
name: Stale

Comments:
I understand that this is an edge case on Windows, and that mingw is not officially supported, but numpy/scipy also don't force msvc, so I though it's worth a try proposing this.

Feedback welcome.
Thanks for the PR. This makes sense, although I think the challenge is more comprehensively how we document the process for users that want to build on Windows. 

I have pretty limited Windows knowledge, but AFAIU we only document currently for the MSVC approach?
https://pandas.pydata.org/pandas-docs/stable/development/contributing_environment.html#step-1-install-a-c-compiler

So if we want to go this route, I think just need to make it clearer to contributors how they can opt in or out of the the different toolchains on Windows
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.
Nothing I can decide or fix (there is no review or failing tests). If someone is interested in this again, please ping me.

We will continue patching pandas downstream in the meantime.
BUG: Fix naive timestamps inheriting timezone from previous timestamps in to_datetime with ISO8601 format
State: closed

- [x] closes #61389 (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: Timezones
description: Timezone data dtype

Comments:
Thanks @myenugula
BUG: round on object columns no longer raises a TypeError
State: closed

- [x] closes #61206 (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: Bug
name: Regression
description: Functionality that used to work in a prior pandas version
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations

Comments:
`pre-commit.ci` is timing out and the 2 failed unit tests are canceled operations. 
@KevsterAmp could you target this PR to `main`? We have a process to backport this PR to the `2.3.x` branch after it is merged to main
Rebased to main and forced push the branch.

@mroeschke since we're targetting to main. Should I add to `whatsnew/v3.0.0.rst` and remove the current `whatsnew/v2.3.0.rst`?
> Should I add to whatsnew/v3.0.0.rst and remove the current whatsnew/v2.3.0.rst

No need. It's implied that all fixes in 2.3 apply to 3.0
Thanks @KevsterAmp 
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
git checkout 2.3.x
git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
git cherry-pick -x -m1 6a2da7ad16cff82f0eadbec04e921baf6c0ae8fb
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
git commit -am 'Backport PR #61399: BUG: round on object columns no longer raises a TypeError'
```

4. Push to a named branch:

```
git push YOURFORK 2.3.x:auto-backport-of-pr-61399-on-2.3.x
```

5. Create a PR against branch 2.3.x, I would have named this PR:

> "Backport PR #61399 on branch 2.3.x (BUG: round on object columns no longer raises a TypeError)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the `Still Needs Manual Backport` label once the PR gets merged.

If these instructions are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
DOC: add `api.types.is_dtype_equal` into document
State: closed

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

Comments:
@datapythonista Thank you for the review and for pointing out how to fix the CI error! 🙏
Subplot title count fix + fix for issue introduced in earlier PR 
State: closed

- [x] closes #61019  
- [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).
- [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.

Adds a check for length of subplots as an alternative to the default title check and produces an alternative error message if number of subplots does not match titles produced.

Additionally, includes fix for issues introduced during PR: #61340 and mentioned in #61018 

Labels:
name: Visualization
description: plotting

Comments:
Thanks again @eicchen
fix MultiIndex.difference not working with PyArrow timestamps (#61382) ,and some ruff formating fix
State: closed

## Problem
The `MultiIndex.difference` method fails to remove entries when the index contains PyArrow-backed timestamps (`timestamp[ns][pyarrow]`). This occurs because direct tuple comparisons with PyArrow scalar types are unreliable during membership checks, causing entries to remain unexpectedly.

**Example**:
```python
# PyArrow timestamp index
df = DataFrame(...).astype({"date": "timestamp[ns][pyarrow]"}).set_index(["id", "date"])
idx_val = df.index[0]
new_index = df.index.difference([idx_val])  # Fails to remove idx_val
```
Solution
Code Conversion: Map other values to integer codes compatible with the original index's levels.

Engine Validation: Use the MultiIndex's internal engine for membership checks, ensuring accurate handling of PyArrow types.

Mask-Based Exclusion: Create a boolean mask to filter out matched entries, then reconstruct the index.

Testing
Added a test in pandas/tests/indexes/multi/test_setops.py that:

Creates a MultiIndex with PyArrow timestamps.

Validates difference correctly removes entries.

Skips the test if PyArrow is not installed.

Use Case Impact
Fixes scenarios where users filter hierarchical datasets with PyArrow timestamps, such as:

```python
# Remove specific timestamps from a time-series index
clean_index = raw_index.difference(unwanted_timestamps)
```
Closes #61382.

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.
BLD: Try using shared memory utilities in Cython to reduce wheel sizes
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: Build
description: Library building on various platforms

Comments:
around 10% savings in both compressed/uncompressed size
(1MB compressed, 4MB uncompressed)

scikit-learn seems to have gotten a lot more mileage out of this optimization...
(they report around 25% savings)
This looks pretty good as is, and will definitely be worthwhile to do - it's a major gain in binary size for only 20 lines of code or so. It should work now, maybe retrigger CI after dropping the Cython pin?
pre-commit.ci autofix
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
git checkout 2.3.x
git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
git cherry-pick -x -m1 341f1612a984e6d990ffa1d3302a220deeadad92
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
git commit -am 'Backport PR #61384: BLD: Try using shared memory utilities in Cython to reduce wheel sizes'
```

4. Push to a named branch:

```
git push YOURFORK 2.3.x:auto-backport-of-pr-61384-on-2.3.x
```

5. Create a PR against branch 2.3.x, I would have named this PR:

> "Backport PR #61384 on branch 2.3.x (BLD: Try using shared memory utilities in Cython to reduce wheel sizes)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the `Still Needs Manual Backport` label once the PR gets merged.

If these instructions are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                
Probably ok to punt this to 3.0 since that's happening soon and to minimize risk for 2.3.
Fix alignment in Series subtraction with MultiIndex, Index and NaN values (#60908)
State: open

This pull request fixes #60908 , where subtracting a Series with a MultiIndex containing NaN values from a Series with a regular Index could lead to incorrect results or unexpected behavior.

The issue was caused by the _align_for_op method not properly handling cases where the left-hand Series had a MultiIndex and the right-hand side had a flat Index, especially when NaN values were present. This could lead to misalignment during arithmetic operations.

To fix this, the _align_for_op method was updated to:

- Ensure that when the left Series has a MultiIndex and the right Series has a regular Index, the right Series is properly reindexed based on the first level of the left-hand MultiIndex, even when NaN values are involved.

- Correctly handle cases where either Series is empty.

Additionally, a new test test_series_subtraction_with_nan_and_levels (added in test_subtraction_nanindex) was introduced to verify that:

- Subtracting a Series with a MultiIndex (including NaNs) from a regular Index works correctly.

- The result maintains the correct alignment and expected output values.

Tested with x86-64 linux. Doesn’t reproduce on Linux-32-bit.

Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: MultiIndex
name: Stale

Comments:
Hi, just following up on this PR. Let me know if you have any feedback or if anything is needed from my side. 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.
DOC: Fix dark mode text visibility in Getting Started accordion (#60024)
State: closed

- [x] closes [#61377](https://github.com/pandas-dev/pandas/issues/61377) (duplicate of [#60024](https://github.com/pandas-dev/pandas/issues/60024))

### 📄 **Description**

This pull request fixes the issue described in [#61377](https://github.com/pandas-dev/pandas/issues/61377), where the text in the accordion content of the *Getting Started* tutorial section was not visible in dark mode.

Although #61377 is a duplicate, the underlying problem was originally reported in [#60024](https://github.com/pandas-dev/pandas/issues/60024), and later duplicated in [#60041](https://github.com/pandas-dev/pandas/issues/60041) and [#60921](https://github.com/pandas-dev/pandas/issues/60921). This PR addresses the root cause described in those issues.

### ✅ **Changes Made**

Added CSS variables to ensure that text and background colors are consistent with the active theme:

```css
.tutorial-card .card-header {
  --bs-card-cap-color: var(--pst-color-text-base);
  color: var(--pst-color-text-base);
  cursor: pointer;
  background-color: var(--pst-color-surface);
  border: 1px solid var(--pst-color-border);
}

.tutorial-card .card-body {
  background-color: var(--pst-color-on-background);
  color: var(--pst-color-text-base);
}
```


Labels:
name: Docs

Comments:
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/61379/
Thanks @danielpintosalazar
DOC: update pandas cheat sheet with a third page (fixes #40680)
State: closed

- [x] closes #40680
- [x] added 3rd page to the cheat sheet including more details on plotting, frequently used options, input/output formats and more.
- [x] added `.info()`, `.memory_usage()`, and `.dtypes()` to 'Summarize Data' on page 2 and rearranged the page to fill the gap left by the old plotting section.


Labels:
name: Docs

Comments:
Thanks for the feedback, this is my first time contributing to anything so thanks for being so constructive. I think I've addressed all the issues raised. Changes have been pushed so let me know if anything else needs updating!
Thanks again, I've updated the powerpoint according to the feedback, made the pdf version, and editted the README.md file as well.
@Shoestring42 looking forward to having you address my last comment here:  https://github.com/pandas-dev/pandas/pull/61378#pullrequestreview-2809938830

changes have been pushed. Sorry it took so long, exam period has just started at uni so i've been busy revising. Thanks for your patience.
BUG: Series.dot for arrow and nullable dtypes returns object-dtyped series
State: closed

fixes #61375 by porting DataFrame fix (from #54025 as reported in #53979)

- [x] closes #61375 
- [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: Numeric Operations
description: Arithmetic, Comparison, and Logical operations
name: Arrow
description: pyarrow functionality

Comments:
Thanks @theavey
Percentile Scaling Data Transformation
State: closed

This pull request adds a new data transformation utility called `percentile_scaling` to the `pandas/io/` module, which scales numerical data to a percentile-based range from 0 to 100. This transformation is useful for standardizing features in data preprocessing workflows, especially for ML pipelines or percentile-based visual analytics.

Implementation Details

- Introduced a new function `percentile_scaling(data: List[float]) -> List[float]` that:
  - Accepts a list or NumPy array of numerical values.
  - Returns values scaled to a [0, 100] percentile scale.
  - Raises appropriate errors for invalid input (e.g., zero variance or empty input).

Tests

- Added unit tests in `pandas/tests/io/test_percentile_scaling.py`:
  - Validates correct scaling behavior.
  - Handles edge cases such as identical values and empty inputs.
  - All tests pass successfully using `unittest`.

Compliance

- [x] Follows Pandas contribution guidelines
- [x] All tests pass successfully
- [x] Function is self-contained and does not introduce dependencies
- [x] Code is PEP8-compliant and cleanly documented

Notes

This contribution is part of a university-level data engineering course project (DATA 226). The goal is to implement practical transformation logic for real-world data pipeline use cases while following standard open-source contribution workflows.


- [x] Tests added and passed
- [x] Code passes style checks and pre-commit hooks


Labels:

Comments:
Thanks for the PR, but since there is no open issue associated with this PR that has also been triaged and accepted by the core team, we will not be moving forward with this feature so closing.
Fix pyarrow comparison issue in array.py
State: closed

- [x] closes #60937 
- [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.
- [ ] 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.
DOC: Add missing period in sample docstring
State: closed

- Minor documentation fix.
- Adds a missing period at the end of the "random_state" description in the `sample` function docstring.
- No functional changes.

- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).


Labels:
name: Docs

Comments:
Thanks @yanamis
[minor edit] edit definitions of some parameters with correct idiomatic English for better legibility
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 @kirisakow