BrandonFors/pandas-github-issues huggingface dataset:
CI: Fix the deprecation bot
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 works locally, at least on my fork.

See https://github.com/pandas-dev/pandas/issues/50578#issuecomment-1581194128 for what I think went wrong the other time this was tried.

Labels:
name: CI
description: Continuous Integration

Comments:
Thanks @lithomas1
TST: Add test for apply cast types GH#9506
State: closed

- [ ] closes #9506 (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: Testing
description: pandas testing functions or related to the test suite

Comments:
Thanks @liang3zy22
ex1.py added.
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:
@mroeschke could you block this user please? they already raised https://github.com/pandas-dev/pandas/pull/53590 . thanks :raised_hands:
PERF: Series.str.split(expand=True) for pyarrow-backed strings
State: closed

- [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/v2.1.0.rst` file if fixing a bug or adding a new feature.

Perf improvement for `Series.str.split` with `expand=True` for `ArrowDtype(pa.string())`:

```
import pandas as pd
import pyarrow as pa

N = 10_000
data = ["foo|bar|baz"] * N
ser = pd.Series(data, dtype=pd.ArrowDtype(pa.string()))

%timeit ser.str.split("|", expand=True)

# 93.8 ms ± 2.85 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  -> main
# 5.43 ms ± 201 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)  -> PR
```

Labels:
name: Performance
description: Memory or execution speed performance
name: Strings
description: String extension data type and string data
name: Arrow
description: pyarrow functionality

Comments:
Nice! Thanks @lukemanley
fix Series.apply(..., by_row)
State: closed

Fixes https://github.com/pandas-dev/pandas/pull/53400#discussion_r1223790606 by making the `by_row` param take `no_default` as its default parameter.


Labels:

Comments:
This moves in the right direction, but I think we still run into issues with the deprecation.

```
df = pd.DataFrame({'a': [1, 1, 2], 'b': [3, 4, 5]})

# On 2.0.x
print(df.apply([lambda x: 1]))
#          a        b
#   <lambda> <lambda>
# 0        1        1
# 1        1        1
# 2        1        1

# On main
print(df.apply([lambda x: 1]))
#           a  b
# <lambda>  1  1
```

Here, pandas is internally calling agg, which then splits up the DataFrame.agg into Series.agg on each column, and then this calls Series.apply. So we end up in Series.apply but with no way for the user to specify `by_row=False`.

One way around this would be to stop breaking up the DataFrame.agg into Series.agg calls and instead breakup the list `func` into individual `DataFrame.agg` calls, but then we run into #45658.  If we try to do this without changing the behavior, we end up losing dtype information because of the transpose.

The only other way I see forward is to add a `by_row` argument to `DataFrame.apply` that is only used for list-likes (and maybe dict-likes?). This seems not straightforward from a user perspective. Maybe I'm overlooking another alternative?
I've made a new PR for this, see #53601, so I'm closing this.
API: MultiIndex attributes return tuple instead of FrozenList
State: closed

- [ ] closes #53531 (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: API Design
name: MultiIndex

Comments:
I'll just reopen later once it's closer to 3.0
ENH: Groupby.transform support string input with engine=numba
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: Groupby
name: numba
description: numba-accelerated operations

Comments:
Thanks @lithomas1
DOC: Fixing EX01 - Added examples
State: closed

- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Towards https://github.com/pandas-dev/pandas/issues/37875



Labels:
name: Docs

Comments:
Looks pretty good. Could you merge in main?
Thanks @DeaMariaLeon
DOC: Multi-conditional examples added to .loc docstring
State: closed

- [ ] closes #53546 

Adds two examples of using `.loc` with multiple conditions and links to Boolean Indexing [user guide](https://pandas.pydata.org/pandas-docs/dev/user_guide/indexing.html#boolean-indexing).

NOTE: I was unable to get the documentation to build on my computer so I could not view the changes before opening this PR. I will have to view them by trying the `/preview` comment.


Labels:
name: Docs

Comments:
Also please ensure you are running pre commit on your code changes https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit
Thanks @sweisss
DEPR: deprecate obj argument in GroupBy.get_group
State: closed

- [x] closes #53545
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

`obj` argument was deprecated in `GroupBy.get_group` and removed from the parameters in `GroupBy.get_group` docs.

Labels:
name: Groupby
name: Deprecate
description: Functionality to remove in pandas

Comments:
@rhshadrach,  could you please take a look at this pr?
Thanks for the PR! This is indeed how the code should look after the deprecation is enforced. However we need to first introduce the deprecation so as to not break any user code but rather warn them about the change. If you're unfamiliar with this, I would suggest looking at merged PRs with the "Deprecate" label to get a better sense as to what this entails.
Thank you, @rhshadrach for the comment. Sorry, my fault, I corrected my pr. Could you please take a look at update.
Thank you @rhshadrach for reviewing this. Sorry for the delay with adding the test.
ENH: Allow comment lines to be written to CSV outputs. Complements read_csv's comment param
State: closed

- [ ] [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.

---
There are many use cases (especially in the scientific community) where the best/only course of action is to enable to embedding of configuration parameters and/or other metadata into the beginning of a CSV file itself. These are typically prefaced with some comment-indication prefix such as `#`. This maintains human readability while attaching the metadata to the generated file itself.

Pandas' `read_csv` method already implements a feature to read such files and ignore these lines when parsing the the data into a dataframe. This PR implements the complement of this feature. It allows users to write these metadata and/or comment lines in their CSV outputs as well.

The `to_csv` method was extended to allow a `comment` param matching that in `read_csv` along with a `comment_lines` param which takes an iterator of strings, each of which will be written to the beginning of the file as a single line, prior to and CSV header or body data being written.

Labels:

Comments:
Thank you @canthonyscott for your PR. When proposing a new feature, it is typically better to first open an issue before implementing it to get feedback on the idea.

`to_csv` supports file handles, so a user could "easily" (but probably less convenient) have their own wrapper:
```py
with open("test.csv", mode="wt") as handle:
    handle.write(comments)
    dataframe.to_csv(handle)
```


That makes total sense. I can go open one. I may have been a little over-eager to try and see if what I wanted to do was an actual possibility first. Thank you!
Closing this PR as discussion in the issue has led to a better solution
DEPR: deprecate unit parameters ’T’, 't', 'L', and 'l'
State: closed

- [x] closes #52536
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Added upper case ’T’ for minutes in `UnitChoices` list. Now mypy doesn’t raise an error.

Update:
Deprecated unit parameters ’T’, 't', 'L', 'l', and fixed test.

Labels:
name: Deprecate
description: Functionality to remove in pandas

Comments:
@jbrockmendel, could you please take a look at this pr?
along with these i think we need to track down other places where we use/allow these codes.  _attrname_to_abbrevs/_abbrev_to_attrnames and Tick._prefix come to mind.  Doesn't need to be this PR, but hopefully a follow-on
Thank you @MarcoGorelli for reviewing this pr.
merging then, thanks!
Why do this? This is a pain in the ass for people 
> Why do this? This is a pain in the ass for people

looks like it comes from [here](https://github.com/pandas-dev/pandas/issues/52536#issuecomment-1581655087)
ENH: Numba groupby support multiple labels
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.

@mroeschke 
Looks like you disabled this in #47057, but it seems to work fine at least for the non-MI index case.
Did you only mean to disable multiple labels for the MI case? Just wanted to make sure I'm not missing anything.

Labels:
name: numba
description: numba-accelerated operations

Comments:
Nice catch thanks @lithomas1. I think this was an oversight on my part back then
DOC: Fixing EX01 - Added examples
State: closed

- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Towards https://github.com/pandas-dev/pandas/issues/37875


Labels:
name: Docs

Comments:
Could you merge in main once more?
Thanks @DeaMariaLeon
TST: Add test for timedelta of fraction GH#9048
State: closed

- [ ] closes #9048 (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: Testing
description: pandas testing functions or related to the test suite

Comments:
Thanks @liang3zy22
TST: Add test for complex categories GH#16399
State: closed

- [ ] closes #16399 (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: Testing
description: pandas testing functions or related to the test suite

Comments:
Thanks @liang3zy22
CI/DEPS: Add xfail(strict=False) to related unstable sorting changes in Numpy 1.25
State: closed

Notes:

* Due to https://github.com/numpy/numpy/pull/23707 and our usage of an unstable sorting algorithm (quicksort) everywhere and the CI runners able to use AVX-512

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

Comments:
Going to merge to get the CI green, but I think discussion on what to do should happen in https://github.com/pandas-dev/pandas/issues/53558
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.0.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 bdfaca634e9946c0612c497456332fee80e7db37
```

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

```
git commit -am 'Backport PR #53548: CI/DEPS: Add xfail(strict=False) to related unstable sorting changes in Numpy 1.25'
```

4. Push to a named branch:

```
git push YOURFORK 2.0.x:auto-backport-of-pr-53548-on-2.0.x
```

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

> "Backport PR #53548 on branch 2.0.x (CI/DEPS: Add xfail(strict=False) to related unstable sorting changes in Numpy 1.25)"

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).
TST: Remove inheritance from pandas/tests/indexes 
State: closed

Replaced the inheritance structure of `pandas/tests/indexes` to use parameterization to make them more independent. Tests are skipped appropriately where they are tested in the old subclass.

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Index
description: Related to the Index class or subclasses

Comments:
neat!  the mixed inheritance/fixture layout is tough to follow
TST: Clean up finalize tests
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: Testing
description: pandas testing functions or related to the test suite
name: metadata
description: _metadata, .attrs

Comments:
Thanks @lithomas1
BUG: Fix metadata propagation in reductions
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: metadata
description: _metadata, .attrs

Comments:
pre-commit.ci autofix
Thanks @lithomas1
DOC: Fixing EX01 - Added more examples
State: closed

- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Towards https://github.com/pandas-dev/pandas/issues/37875



Labels:
name: Docs

Comments:
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/53540/
I think that the new failing test is not related to this.
Thanks @DeaMariaLeon
BUG: Fix metadata propagation in squeeze and describe
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: metadata
description: _metadata, .attrs

Comments:
Thanks @lithomas1
BUG: Series.str.split(expand=True) for ArrowDtype(pa.string())
State: closed

- [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/v2.0.3.rst` file if fixing a bug or adding a new feature.

main:
```
In [1]: import pandas as pd

In [2]: import pyarrow as pa

In [3]: ser = pd.Series(["a", "a|b", "a|b|c"], dtype=pd.ArrowDtype(pa.string()))

In [4]: ser.str.split("|", expand=True)
Out[4]: 
   0
0  a
1  a
2  a
```

PR:
```
Out[4]: 
   0     1     2
0  a  <NA>  <NA>
1  a     b  <NA>
2  a     b     c
```


Labels:
name: Bug
name: Strings
description: String extension data type and string data
name: Arrow
description: pyarrow functionality

Comments:
Thanks @lukemanley 
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.0.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 66468cecba6a1b17d2e12ff79da0b87f16118726
```

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

```
git commit -am 'Backport PR #53532: BUG: Series.str.split(expand=True) for ArrowDtype(pa.string())'
```

4. Push to a named branch:

```
git push YOURFORK 2.0.x:auto-backport-of-pr-53532-on-2.0.x
```

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

> "Backport PR #53532 on branch 2.0.x (BUG: Series.str.split(expand=True) for ArrowDtype(pa.string()))"

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: create a table for period aliases
State: closed

related to pr #53477
Updated documentation for [Time series / date functionality](https://pandas.pydata.org/docs/user_guide/timeseries.html#time-series-date-functionality)

Created a new table for `period aliases`. Added to the doc of `Period dtypes`reference to the table `period aliases` instead of [offset aliases](https://pandas.pydata.org/docs/user_guide/timeseries.html#timeseries-offset-aliases). Corrected docs for `to_period`. Pointed out that only frequencies from the table `period aliases` are valid for `to_period`. 

Labels:
name: Docs
name: Period
description: Period data type

Comments:
@MarcoGorelli,  could you please take a look at this pr?
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/53530/
> I just have a comment - you write "we will refer to these aliases as _period aliases_", but then in the `to_period` docstring you write "period strings". Perhaps that should say "period aliases" instead?
>

Thank you, @MarcoGorelli for the comment. I corrected `to_period` docstring, as you suggested.

Thanks @natmokval