BrandonFors/pandas-github-issues huggingface dataset:
DEPR: Index.format
State: closed

- [x] closes #55413 (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.
- [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: Output-Formatting
description: __repr__ of pandas objects, to_string
name: Deprecate
description: Functionality to remove in pandas

Comments:
Thanks @jbrockmendel
DOC: Add DataFrame.index.levels
State: closed

- [X] xref #55435
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Add docstrings for MultiIndex.levels and MultiIndex.codes



Labels:
name: Docs
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves

Comments:
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/55437/
Looks like something is broken in the last part of the examples, you can see it here: https://pandas.pydata.org/preview/55437/docs/reference/api/pandas.MultiIndex.levels.html#pandas.MultiIndex.levels

Can you have a look please?
> Amazing work @shiersansi, thanks a lot for working on this!

Thank you for your help and advice. Your help has made me understand more about how to contribute to open source projects, and I have learned a lot through this docstring modification
> > Amazing work @shiersansi, thanks a lot for working on this!
> 
> Thank you for your help and advice. Your help has made me understand more about how to contribute to open source projects, and I have learned a lot through this docstring modification

Amazing, I'm glad to hear. Feel free to continue working in other things, and please let me know if you need help. For this PR we'll wait until the CI finishes, and another core developer has time to review it, in case I missed something, but it should be ready from your side.
Thanks @shiersansi
Doc: add DataFrame.index.levels
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.
- [x] Added an entry in the latest `doc\source\user_guide\indexing.rst` file  adding a new feature.

> solved problem

BUG: MultiIndex.levels[x] of sliced DataFrame returns values from the non-sliced index #55148
[https://github.com/pandas-dev/pandas/issues/55148](url)

> Description:

Adding DataFrame.index.levels to doc will show the original value after reducing the data frame reason: pandas only updates the code at slicing time, not the level.

> Add content details

![屏幕截图 2023-10-07 125621(1)](https://github.com/pandas-dev/pandas/assets/143710553/6088db73-5573-4e38-b44f-d69273d61142)


Labels:

Comments:
@shiersansi this is the issue: #55435

I'm going to close this PR since I think it'll be easier for you to start from scratch, as everything in this PR needs to be reverted. But you're surely welcome to continue the work on this. Thank you!
REF: remove redundant Index formatting methods
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: Refactor
description: Internal refactoring of code
name: Output-Formatting
description: __repr__ of pandas objects, to_string

Comments:
Thanks @jbrockmendel
WEB: Fix rendering of ntv-pandas ecosystem page
State: closed

Change rendering bullet list in #55421 
- [ ] 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: Web
description: pandas website

Comments:
Sorry, I was not available today.

Thanks @datapythonista for your suggested changes, I agree with all of them.
The commit is done.
CoW: add warning mode for cases that will change behaviour
State: closed

xref https://github.com/pandas-dev/pandas/issues/56019, https://github.com/pandas-dev/pandas/issues/48998

An initial PR working towards one of the remaining TODO items:

> Add a warning mode that gives deprecation warnings for all cases where the current behaviour would change (initially also behind an option) 

The current PR adds an option `pd.options.mode.copy_on_write = "warn"`, and then everything behaves as the current default (without CoW enabled) but will raise a warning in case the behaviour will change if CoW would be enabled.

As a first step, this PR adds the option, and adds the warning in one specific code path that can trigger CoW, i.e. updating a Series (`Manager.setitem_inplace`). So this covers a typical case like:

```
s = df["col"]
s[0] = ..
```

no longer updating `df`.

In addition, I also turned off SettingWithCopyWarning when the CoW warning mode is enabled (because in that case, those warnings are no longer correct for the future behaviour, and it seemed better to not raise both kinds of warnings at the same time)

Labels:
name: Copy / view semantics

Comments:
There are still a whole bunch of failures (with the warning mode enabled, for which I still need to add a CI build), but quite some of them are due to inplace operators (eg `s += 1`) unnecessarily triggering CoW, which is something I will try to tackle as a precursor.
@phofl I removed the last commit about the chained assignments again, and moved that to a separate PR (https://github.com/pandas-dev/pandas/pull/55522). So this PR then just focuses on adding the infrastructure, and the warnings for (non-chained) series setitem (the things going through `setitem_inplace`). Then once this is merged, I can work more easily in parallel on different areas.
I added a `tm.assert_cow_warning` helper function to use for all the cases where specifically checking for this warning.

@phofl @mroeschke if possible, I would like to get this merged shortly if possible, as there is a lot more work to do here, but that will be easier done in parallel once this base PR is in.
I’ll check later today or tomorrow 
thx @jorisvandenbossche
DOC: Remove outdated docs about NumPy's broadcasting
State: closed

NumPy v1.25.0 removes the previosuly deprecated behavior of returning `False` when an array could not be broadcast. It now raises a `ValueError`, same as Pandas. https://github.com/numpy/numpy/pull/22707
The Pandas documentation previously highlighted this discrepancy. However, since it now throws an error, it is causing building the documentation to fail.

I removed the mention of NumPy in this section since the behavior is mostly the same (NumPy still treats an array of one item as a scalar, while Pandas doesn't). Would it be preferable to mention that they act the same now?

Labels:
name: Docs

Comments:
Thanks @RedGuy12 
@MeeseeksDev backport to 2.1.x
add `ntv-pandas` to the ecosystem 
State: closed

As defined in the conclusion of the [PDEP-12](https://pandas.pydata.org/pdeps/0012-compact-and-reversible-JSON-interface.html), add `ntv-pandas` to the ecosystem .

- [ ] 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 @loco-philippe 
Thanks @loco-philippe, very nice, please have a look at the rendered site, this update should be updated shortly, and open a follow up PR is something is not displayed as expected.
Thank you very much for your time and help, you were efficient and quick !

The rendering of the bullet list is not ok ->  I will open an other PR.

Note: I have the same rendering problem with the last update of the PDEP-12, i will open another PR too
REF: remove unused box keyword from Timedelta64Formatter
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: Output-Formatting
description: __repr__ of pandas objects, to_string
name: Timedelta
description: Timedelta data type

Comments:
Thanks @jbrockmendel
Series.__repr__ with MultiIndex with level name 0
State: closed

- [ ] 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.
- [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: Output-Formatting
description: __repr__ of pandas objects, to_string
name: MultiIndex

Comments:
Nice find. Thanks @jbrockmendel
CI: Pin Cython
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.

Looks like we are picking up some compile failures from Cython 3.0.3.


Labels:
name: Build
description: Library building on various platforms
name: CI
description: Continuous Integration

Comments:
Thanks, could you also raise an issue in Cython as well?
https://github.com/cython/cython/issues/5747
Thanks @lithomas1
BUG: fix for datetime parse error for more than 50 rows
State: closed

- [x] closes #55345 
- [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.

This issue seems to be caused due to the fix provided in #45319 . I have added kind of a check but the implementation doesn't seem very clean to me. Would be open to any suggestions. TiA!


Labels:
name: Datetime
description: Datetime data dtype

Comments:
@MarcoGorelli can I please get a little help here? I am kind of stuck.
hey - looks like tests are failing - I'd suggest stepping through a debugger to figure out where things might be going wrong
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.
TYP: read_csv and read_excel fixes
State: closed

read_csv's date_format accepts dicts
read_excel's names can be a Sequence with any Hashable types inside


edit: should probably enable type-checking of some tests (`def test_xxx(...) -> None` should be enough for mypy to check what is happening inside the function) 

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

Comments:
Thanks @twoertwein
Fix new string dtype tests for frame folder
State: closed

This is the first of many folders...

Labels:
name: Strings
description: String extension data type and string data
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.
cc @mroeschke

gentle ping
Thanks @phofl
TST: GroupBy.ffill on a multi-index dataframe
State: closed

For additional information, we have explained how this new automated test work on first commit description.

- [x] closes #43412
- [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).


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

Comments:
Thanks @josemayer
BUG: TimedeltaIndex.__repr__ with non-nano and round values
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: Output-Formatting
description: __repr__ of pandas objects, to_string
name: Timedelta
description: Timedelta data type

Comments:
Thanks @jbrockmendel
MAINT: Add warning filter for `np.long`
State: closed

Hi!
This is a one-line follow-up PR after https://github.com/pandas-dev/pandas/pull/55369.
Downstream libs that use nightly pandas and numpy will see a warning without it (there was a similar fix for scipy: https://github.com/scipy/scipy/pull/19341). 

Labels:
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
Hello (again) and thanks for this PR. I am seeing the warning but this time from `pandas` instead of `scipy`.

https://github.com/pandas-dev/pandas/blob/06cdcc0576e387551462511f82d3eed8c02be570/pandas/compat/numpy/__init__.py#L29

Example log: https://github.com/spacetelescope/jdaviz/actions/runs/6407816486/job/17396675526?pr=2492
Great thanks @mtsokol 
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.1.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 eb6317a3cf45dfeb76f81655310604de029ad596
```

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

```
git commit -am 'Backport PR #55397: MAINT: Add warning filter for `np.long`'
```

4. Push to a named branch:

```
git push YOURFORK 2.1.x:auto-backport-of-pr-55397-on-2.1.x
```

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

> "Backport PR #55397 on branch 2.1.x (MAINT: Add warning filter for `np.long`)"

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).
                
@meeseeksdev backport 2.1.x
BUG: avoid DeprecationWarning when the Series has index as list of Series
State: closed

- [ ] Closes #55228
- [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 an entry in the latest `doc/source/whatsnew/v2.1.4.rst` file


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

Comments:
@jbrockmendel I have adapted your suggestion of runtime importing `ABCSeries` and `ABCIndex`. However, is this also allowing `MultiIndex` which I think is not valid?
> However, is this also allowing MultiIndex which I think is not valid?

Then exclude ABCMultiIndex i guess
@jbrockmendel Sorry that I forgot about this PR. I have excluded `ABCMultiIndex` now.
Looks pretty good. Could you resolve the merge conflict?
Done @mroeschke 
Done @mroeschke, sorry for the delay.
Thanks @Charlie-XIAO 
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.1.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 171cbcd3a6e79a5b845f39d2304d664bec10b9db
```

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

```
git commit -am 'Backport PR #55395: BUG: avoid DeprecationWarning when the Series has index as list of Series'
```

4. Push to a named branch:

```
git push YOURFORK 2.1.x:auto-backport-of-pr-55395-on-2.1.x
```

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

> "Backport PR #55395 on branch 2.1.x (BUG: avoid DeprecationWarning when the Series has index as list of Series)"

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).
REF: formats.format functions that should be DTA methods
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: Refactor
description: Internal refactoring of code
name: Output-Formatting
description: __repr__ of pandas objects, to_string

Comments:
updated+green. this and #55405 are blockers for several in-progress branches.
Thanks @jbrockmendel
TYP: format.formats
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: Output-Formatting
description: __repr__ of pandas objects, to_string
name: Typing
description: type annotations, mypy/pyright type checking

Comments:
Thanks @jbrockmendel
CLN: Replace _selected_obj with _obj_with_exclusions in SeriesGroupBy
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.

This is a revert of #49136 and part of #46944. I was originally aiming to remove instances of `_obj_with_exclusions` until @jbrockmendel pointed out we could (and now have) remove the group selection context by using this over `_selected_obj`.

Labels:
name: Groupby
name: Clean

Comments:
Thanks @rhshadrach