BrandonFors/pandas-github-issues huggingface dataset:
BLD: Build wheels with numpy 2.0rc1
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:
Thanks @lithomas1 
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.2.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 9cd5e5546c36c54dc8c3fab3dc20b092f812362e
```

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

```
git commit -am 'Backport PR #58126: BLD: Build wheels with numpy 2.0rc1'
```

4. Push to a named branch:

```
git push YOURFORK 2.2.x:auto-backport-of-pr-58126-on-2.2.x
```

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

> "Backport PR #58126 on branch 2.2.x (BLD: Build wheels with numpy 2.0rc1)"

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).
CLN: enforce deprecation of the `kind` keyword on df.resample/ser.resample
State: closed

xref #55895
enforced deprecation of the kind keyword on df.resample/ser.resample

Labels:
name: Resample
description: resample method
name: Clean

Comments:
I enforced deprecation of the `kind` keyword on `df.resample/ser.resample`.
@jbrockmendel, could you please take a look at this PR?
@ChadFulton any objection to moving forward with this part of the deprecation?
Thanks @jbrockmendel, this change makes a lot of sense to me!
Thanks @natmokval
DEPR: keyword-only arguments for DataFrame/Series statistical methods
State: closed

- [x] closes #57087 (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.
- [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

Comments:
pre-commit.ci autofix
Thanks @Aloqeely
BUG: Timestamp.unit now reflects changes in components after Timestamp.replace
State: closed

- [x] closes #57749
- [x] [Tests added and passed]
- [x] All [code checks passed]
- [x] Added an entry in the latest `doc/source/whatsnew/v3.0.0.rst`

The logic behind this is having the `Timestamp.unit` set as the most precise unit changed on `Timestamp.replace` if one is more precise than the previous set. 


Labels:
name: Non-Nano
description: datetime64/timedelta64 with non-nanosecond resolution
name: Timestamp
description: pd.Timestamp and associated methods

Comments:
Hey, I've made the requested changes.

cc @jbrockmendel 
@jbrockmendel @mroeschke Hey!! Sorry for the ping but it's been a while since I last heard from you, is this change still of interest?

Let me know If you need anything from me :)
@jbrockmendel  I see you made a change on this files recently, does this still work as intended?
I haven't heard from you in a while. Is this still on track to be merged?
Hey @mroeschke after speaking with him it is of my understanding that @jbrockmendel is taking some time mostly-off contributing for pandas, he indicated that you might be able to review this in the meantime? thanks in advance
Could you add a test like

```python
ts = pd.Timestamp(year=2020, month=1, day=1, nanosecond=5)
result = ts.replace(nanosecond=0)
assert result.unit == "s"
```
@mroeschke In fact that logic was not yet implemented, thank you for noticing! I have attempted to solve the issue by registering if a replacement with 0 was made and if so add an extra check to recalculate the replacement resolution. The test now passes successfully.
@mroeschke Hey, I've added the test cases requested!! Had to change some things in the logic but I believe it's working as intended now.
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: Remove deprecated methods from code_checks.sh
State: closed

- [x] xref #58065
- [ ] [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: Code Style
description: Code style, linting, code_checks

Comments:
Could you fix the merge conflict?
Thanks @shriyakalakata
Add note for name field in groupby
State: closed

- [x] closes #58024
- [N/A] [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).
- [N/A] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [N/A] 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 @shriyakalakata
Pixee branch
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:

Comments:
Please review https://github.com/pandas-dev/pandas/pull/58111#issuecomment-2030523217
Pixee branch
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:

Comments:
Thanks for the PR, but it's unclear what this change achieves. I would recommend experimenting on your own fork first or opening a new PR clarifying what your PR achieves
DEPR: rename `startingMonth` to `starting_month` (argument in BQuarterBegin)
State: closed

- [x] closes #57794
- [ ] [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:
You need to deprecate `startingMonth` first
Thanks @Aloqeely ! Could you explain to me how I can deprecate `startingMonth`?
Basically you should still allow `startingMonth`, but if it is used you should warn the user that it will be removed soon
I think a check in `__init__` will do the job but I'm not sure, cc @jbrockmendel 
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: Remove "Mean of empty slice" warning in nanmedian
State: closed

This PR supresses a warning when calculating the `median` of a `pd.Series` that is full of `NA`s. The warning is just letting you know that `numpy` got an empty array but correctly returns `np.nan`.

The warning is issued as follows:
1. When the series has `NA`s and you try to calculate the `median`, `nanops.nanmedian` is called.
2. When the array is full of NAs, the `_mask` in `nanops.nanmedian.get_median` is all `False`, so `np.nanmedian(x[_mask])` gets an empty array.
3. `np.nanmedian` calls `numpy.lib.nanfunctions._nanmedian` which has a short-circuit path when the array is empty [[ref](https://github.com/numpy/numpy/blob/1c8b03bf2c87f081eea211a5061e423285c548af/numpy/lib/_nanfunctions_impl.py#L1215-L1216)].
4. This path calls `np.nanmean`. This creates an empty mask [[ref](https://github.com/numpy/numpy/blob/1c8b03bf2c87f081eea211a5061e423285c548af/numpy/lib/_nanfunctions_impl.py#L1033)] because the array is empty.
5. Then, the sum of the negated mask is used as the denominator of the `mean`, which causes the result to be `np.nan` (correct!).
6. The method issues a warning because the array was empty.

Another way to solve this would be to change `get_median` to explicitly return `np.nan` before the call to `np.nanmedian`, but that would involve tampering with the condition in the if, which has no comments so I'm unsure if changing it makes sense.

```python
    def get_median(x, _mask=None):
        if _mask is None:
            _mask = notna(x)
        else:
            _mask = ~_mask
        all_na = _mask.all()
        if (not skipna and not all_na) or all_na:
            return np.nan
        with warnings.catch_warnings():
            # Suppress RuntimeWarning about All-NaN slice
            warnings.filterwarnings(
                        "ignore", "All-NaN slice encountered", RuntimeWarning
            )
            res = np.nanmedian(x[_mask])
        return res
```
which simplifies to `if skipna: return np.nan` I think.

I haven't added tests nor ensured all of the below passed not added comments because I want to ensure this is the preferred solution. Otherwise, I can edit `get_median`. Let me know!

---

- [ ] [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: Warnings
description: Warnings that appear or should be added to pandas

Comments:
pre-commit.ci autofix
Thanks @sebastian-correa
DOC: fix docstring for DataFrame.to_period, pandas.DataFrame.to_timestamp, pandas.DataFrame.tz_convert #58065
State: closed

Fixes docstring errorrs for DataFrame and Series for methods  `pandas.DataFrame.to_period` ,`pandas.DataFrame.to_timestamp` ,`pandas.DataFrame.tz_convert`. (issue #58065)
- [ ] [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 @bergnerjonas
MNT: fix compatibility with beautifulsoup4 4.13.0b2
State: closed

Closes #58086

- [x] 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: IO HTML
description: read_html, to_html, Styler.apply, Styler.applymap
name: Dependencies
description: Required and optional dependencies

Comments:
I'm not sure this change warrants a changelog entry, but I'll happily add one upon request.
Thanks @neutrinoceros (doesn't need a changelog entry)
Thanks for merging ! Would it be alright to backport this ?
Sure I supposed that would be OK
@Meeseeksdev backport 2.2.x
thanks !
BUG: fixed bug where None would appear as 'None' (#57702)
State: closed

- [X] closes #57702 
- [X] added a test that proves this issue is resolved(pandas/tests/arrays/numpy_/test_numpy.py on line 127)




Labels:

Comments:
![image](https://github.com/pandas-dev/pandas/assets/128391338/cf7ef8df-31cb-484d-9014-846e67c2e82f)
im trying to resolve the issues with the pipeline but there's a test that is bothering me (the only test failing in all of the tests)...
my objective with this issue is that a certain routine must be used if there are nones inside of the array given in pd.array
but the thing is that this test in this image is creating an array with 2 series, and raises an exception when it reaches the if (None not in scalars) because 'the truth value of a series is ambigous'
i understand the purpose of this test, but i see no need in filling the np.array with a series, as it's the only time in the whole test directory that it is done, why not just do a regular array? 
![image](https://github.com/pandas-dev/pandas/assets/128391338/a984a52b-6200-46cc-b7f5-9d7f6bab692c)
the test mentioned above was changed to what is seen in the image above
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 docstring errors for pandas.DataFrame.unstack, pandas.DataFrame.value_counts and pandas.DataFrame.tz_localize
State: closed

- Fixes docstring erros for following methods (https://github.com/pandas-dev/pandas/issues/58065):
`pandas.DataFrame.unstack`, `pandas.DataFrame.value_counts` and  `pandas.DataFrame.tz_localize`
- [ ] [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 @bergnerjonas
Remove 'Not implemented for Series' from _num_doc in generic.py
State: closed

Documentation fix in `generic.py`
line 11715: Removed 'Not implemented for Series' in _num_doc given that `numeric_only` is now implemented for Series in all the methods min, max, mean, median, skew, kurt

- [ ] 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 @kamelCased
DOC: read_sql_query docstring contraine wrong examples #58094
State: closed

- [x] closes #58094 
- [ ] [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 @Tonow
CI: Remove deprecated methods from code_checks.sh
State: closed

- [ ] xref #58065 
- [ ] [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: Code Style
description: Code style, linting, code_checks

Comments:
Thanks @Aloqeely
DEPR: Series setitem/getitem treating ints as positional
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: Clean

Comments:
Looks like an error message needs updating in the npdev build
Thanks @jbrockmendel
BUG: Let `melt` name multiple variable columns for labels from a `MultiIndex`
State: closed

- [x] closes #58033
- [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/v2.2.2.rst` file if fixing a bug or adding a new feature.

If there are fewer names provided in `var_name` than levels in the columns `MultiIndex`, then `melt` will just take the first several. I personally find this a bit strange, but it keeps with the previous behavior of `melt` with a `MultiIndex` where you could pass it a single name and it would only use one level of the `MultiIndex`.

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

Comments:
Thanks for the PR! Sorry this hasn't been reviewed yet.
Generally LGTM. cc @mroeschke 
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.
Hi! Just checking in as this issue has been affecting my code. I wondered if anything needed to be done or if this will be merged in a later release?
Thanks @rob-sil 
Thanks for moving this forward!
my code works in jupyter notebook with 'var_names' parameter but not in py file, it gives the same error when running in py file. Interesting.