BrandonFors/pandas-github-issues huggingface dataset:
Add to_snake_case and to_camel_case for index label conversion using …
State: closed

**Add `to_snake_case` and `to_camel_case` methods for Index label conversion**

This PR adds two new string transformation methods to the `pandas.Index` class:

### 🚀 New methods
- `to_snake_case()`: Converts string index labels to `snake_case` using `inflection.underscore`
- `to_camel_case()`: Converts string index labels to `camelCase` using `inflection.camelize`

Both methods:
- Leave non-string values (e.g. integers, `None`) unchanged
- Are chainable and return a new `Index` instance

### 🧪 Tests
Added unit tests for both methods in `test_base.py`:
- Covers strings with mixed case and spaces
- Verifies behavior with mixed-type labels

### 📌 Example
```python
import pandas as pd

df = pd.DataFrame({"first name": [1], "another_column": [1]})
df.columns = df.columns.to_camel_case()
print(df.columns)
# Index(['firstName', 'anotherColumn'], dtype='object')

df.columns = df.columns.to_snake_case()
print(df.columns)
# Index(['first_name', 'another_column'], dtype='object')
```



Labels:

Comments:
Thanks for the PR, but it appears this feature is not tied to an open issue with core developer support. For new APIs, we would need core developer support before adding new API. (Note given the simplicity of this feature, it's unlikely that this would be added to pandas.)

Thanks for the suggestion but closing 
Thanks for your comment and understand your point. This is actually something I've always wanted when dealing with messy column names. Without modifying pandas itself, the code below is the alternative I can think of. Do you have any recommendations?

```
import pandas as pd
import inflection

@pd.api.extensions.register_index_accessor("clean")
class ColumnIndexAccessor:
    def __init__(self, pandas_obj):
        self._obj = pandas_obj

    def to_snake_case(self):
        return self._obj.to_series().apply(
            lambda x: inflection.underscore(x).replace(" ", "_")
        ).values

    def to_camel_case(self):
        return self._obj.to_series().apply(
            lambda x: inflection.camelize(x, uppercase_first_letter=False)
        ).values
```
DOC: Update the last ArcticDB link in ecosystem.md
State: closed

Update the last ArcticDB link in ecosystem.md.

Correct link:
https://docs.arcticdb.io/latest/api/processing/#arcticdb.QueryBuilder

The old link does not work:
https://docs.arcticdb.io/latest/api/query_builder/

- [ ] 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 again @star1327p
DOC: Add real-world aggregation example to GroupBy user guide
State: closed

This PR adds a real-world example using sales data to the GroupBy Aggregation section in the user guide (groupby.rst). This enhances understanding for new users by supplementing the existing animals DataFrame example with a business-style case.

Labels:

Comments:
The failing doc build seems unrelated to the change introduced in this PR, which only adds a real-world GroupBy aggregation example. Please let me know if any adjustments are needed—happy to update.
@pandas-dev/mentors – Submitted my GSOC 2025 proposal to revamp Pandas docs!  
Would love your feedback. Ready to start work from Day 1!
Thanks for the PR, but I don't think this example adds anything additional to these doc so closing. I recommend searching the issue tracker for documentation issues that have been triaged
BUG: Raise error if not busdaycalendar
State: closed

Closes #60647. Raises TypeError if anything other than `None` or `np.busdaycalendar` is passed to `calendar`. Also added test for this exception as well as a note in whatsnew

- [x] closes #60647 (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).
- [ ] 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: 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.
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.
CI Use released numpy for Windows wheels testing
State: closed

Following #61249 this also used released numpy for testing on Windows free-threaded wheels.

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

Comments:
I guess this doesn't fix the nightly wheels failure, since the issue seems related to cython dev according to https://github.com/pandas-dev/pandas/pull/61249.

It could still be worth to merge this PR to use released numpy.

I'll move it ouf of draft, when the wheels are back to green on `main`.
OK I guess this is ready to be reviewed, this simplifies the Windows free-threaded further (on top of #61249) by using released numpy for testing. cc @mroeschke.

The Wheels testing seems to be fine, see [build log](https://github.com/pandas-dev/pandas/actions/runs/14374817755/job/40304732103?pr=61248).

Not quite sure why the mypy error is about since it does not seem related to my PR, see [build log](https://github.com/pandas-dev/pandas/actions/runs/14374817701/job/40304672507?pr=61248).
Thanks @lesteve (and for your initial stab at debugging our wheel failures)
BUG: Handle overlapping line and scatter on the same plot
State: closed

- [x] closes #61005
- [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.

Running the code from the issue above now shows a correct plot.
```python
import datetime
import matplotlib.pyplot as plt
import pandas as pd

datetime_list = [datetime.datetime(year=2025, month=1, day=1, hour=n) for n in range(23)]
y = [n for n in range(23)]
df = pd.DataFrame(columns=['datetime', 'y'])
for i, n in enumerate(datetime_list):
    df.loc[len(df)] = [n, y[i]]
fig, ax = plt.subplots(2, sharex=True)
df.plot.scatter(x='datetime', y='y', ax=ax[0])
df.plot(x='datetime', y='y', ax=ax[1])
```
![image](https://github.com/user-attachments/assets/bd2501ab-4b9c-4507-bb72-2686c27f2455)



Labels:
name: Visualization
description: plotting

Comments:
@mroeschke Thanks for the feedback; I applied your comments.
Thanks @MartinBraquet
DOC Update the awkward-pandas GitHub link
State: closed

In ecosystems.md, the awkward-pandas link should be:  
https://github.com/scikit-hep/awkward

The old link does not work:
https://awkward-pandas.readthedocs.io/

- [ ] 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 @star1327p
BLD/CI: Try to fix the Windows Python 3.13t wheel build
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
name: Windows
description: Windows OS
name: Python 3.13

Comments:
FYI for anyone interested:
The Windows wheel builder CI (just the free-threaded builds) have been failing for the past 2 weeks. It seems like there's omething wonrg with the datetime code. I already took a look at numpy/tzdata versions, but those don't seem to be the problem (and I'm not sure what to look at next).

I don't have time to debug this any further (nor do I have a Windows machine to do so), but if anyone else is interested feel free to push to my branch.
Something you may want to try (in particular to rule out a numpy dev change) is to try to use a released numpy instead of numpy dev.

As I mentioned in https://github.com/pandas-dev/pandas/issues/61242 using numpy dev was needed historically for free-threaded, but there has been a few numpy releases with free-threaded wheels (including Windows).

I opened a draft PR with the changes to use numpy release https://github.com/pandas-dev/pandas/pull/61248.

Not familiar with pandas setup, but probably someone needs to add the label "Build" to my PR or try to push similar changes in this PR branch, whatever seems easier :wink:.
DOC: Added docstrings to min, max, and reso
State: closed

Closes #59458

Added docstrings to `min`, `max`, and `resolution` for class `Timestamp`. Used same approach as seen in PR #61119

- [x] closes #59458 (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: Docs

Comments:
Thanks @j-hendricks
ENH: Add dropna parameter to Series.unique() (fixes #61209)
State: closed

- [x] 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.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

### Changes:
- Added `dropna` parameter to `Series.unique()` (default=True)
- Ensured backward compatibility
- Added comprehensive test coverage

### Notes:
- Changes split into logical commits:
  1. Core functionality (ENH)
  2. Test coverage (TST)

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: Pyarrow timestamp support for map() function
State: closed

- [x] closes #61231  (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).
- [ ] ~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: Stale
name: Arrow
description: pyarrow functionality

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.
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.
ENH: Add dropna parameter to Series.unique() (fixes #61209)
State: closed

- [x] 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
- [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:
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: Fix DatetimeIndex timezone preservation when joining indexes with same timezone but different units
State: closed

- [x] closes #60080
- [x] [Tests added and passed]
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations]
- [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: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Timezones
description: Timezone data dtype

Comments:
Hi @rhshadrach, could you please check this one out?
I agree with @rhshadrach's comment on splitting/parametrizing the test, otherwise this LGTM
Hi @rhshadrach, I see that you've requested changes. Could you please clarify what exactly needs to be changed? as I've already made the changes you've requested about `assert result.tz == idx1.tz`
> Hi @rhshadrach, I see that you've requested changes. Could you please clarify what exactly needs to be changed? as I've already made the changes you've requested about `assert result.tz == idx1.tz`

Once changes are requested, the state doesn't update until another review is submitted.
Thanks @myenugula
BUG:  Fix scatter plot colors in groupby context to match line plot behavior (#59846)
State: closed

- [x] closes #59846
- [x] [Tests added and passed]
- [x] All [code checks passed]
- [x] Added [type annotations]
- [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: Groupby
name: Visualization
description: plotting
name: Stale

Comments:
I removed all unnecessary comments in the test function
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.
@mroeschke I've merged in the main branch. Could you please reopen this PR so I can run it through the GitHub Actions and do further changes if needed? 
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: Fix #61222: Keep index name when resampling with pyarrow dtype
State: closed

- [x] closes #61222
- [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: Resample
description: resample method
name: Arrow
description: pyarrow functionality

Comments:
@mroeschke Thanks for your review. I addressed your comments.
Thanks @mthiboust
Fix false friends in implicit string concatenation in tests
State: closed

[In a PR](https://github.com/nvim-treesitter/nvim-treesitter/pull/7788) about how to syntax-highlight Python docstrings, @rmuir and I discovered that instead of implicit concatenation of strings a string plus a docstring have been written.

Since this is a subtle one, I want to briefly show the differences:
 
The false friend of implicit string concatenation
```python
# var == "foo"

var = "foo"  # <-- no implicit string concatenation
"bar"        # <-- docstring, legal for the bytecode compiler, against PEP 257
```

can be fixed for example with surrounding brackets:
```python
# var == "foobar"

var = (
    "foo"    # <-- gets implicitly concatenated
    "bar"
)
```

I felt free to fix the ones I found right away such that the tests pass.

I searched with [`ripgrep`](https://github.com/BurntSushi/ripgrep) like so:

```sh
# in path/to/cloned/pandas
rg -A 1 -B 2 -U ' = f?"[^"]*"\s+f?"[^"]+"\s*' pandas/
```

I am pretty confident, but not entirely sure, to have catched all cases. :thinking: 

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

Comments:
As a side note:

The tests passed before because they called [`assert_produces_warning`](https://github.com/pandas-dev/pandas/blob/main/pandas/_testing/_warnings.py#L29), which in turn calls [`_assert_caught_expected_warnings`](https://github.com/pandas-dev/pandas/blob/main/pandas/_testing/_warnings.py#L157), where `re.search` is used:

https://github.com/pandas-dev/pandas/blob/04356be7d385dcb99d3040e37a85e1030afb259b/pandas/_testing/_warnings.py#L181-L183

The false friends only gave the first part of the full string to match (the rest was discarded as it was detected as docstring), but `re.search` still gives a positive match in that case.

Maybe it should be `re.fullmatch` instead? :shrug: 
> I am pretty confident, but not entirely sure, to have catched all cases. 🤔

I rechecked the logfile from the script I ran yesterday: these are the same files and lines with highlight differences, so I think you found them all.
Thanks @jbdyn
DOC Removed excessive Plotly links in ecosystem.md
State: closed

Removed excessive Plotly links in `ecosystem.md`.

- [ ] 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 @star1327p
BUG: Fix #61221: Exception with unstack(sort=False) and NA in index. 
State: closed

- [ ✔️ ] closes #61221  
- [✔️ ] [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/v3.0.0.rst` file if fixing a bug or adding a new feature.


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.
Thanks for the pull request, but it appears to have gone stale. Additionally it appears there's a commit for an image we do not want in our history.

If interested in continuing, I'd recommend opening a new PR
BUG: Fix #57608: queries on categorical string columns in HDFStore.select() return unexpected results.
State: closed

In function __init__() of class Selection (pandas/core/io/pytables.py), the method self.terms.evaluate() was not returning the correct value for the where condition. The issue stemmed from the function convert_value() of class BinOp (pandas/core/computation/pytables.py), where the function searchedsorted() did not return the correct index when matching the where condition in the metadata (categories table). Replacing searchsorted() with np.where() resolves this issue.

- [x] closes #57608
- [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: IO HDF5
description: read_hdf, HDFStore

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.
pre-commit.ci autofix
Rebased to include recent upstream changes. I apologize for the unused import in my earlier commit; thank you very much for the quick fix!
Thanks @SofiaSM45