BrandonFors/pandas-github-issues huggingface dataset:
DOC: Fix column alignment in df.mul docstring
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.

Found an alignment issue in the documentation that was due to a few tabs being in there. Changing them to spaces fixes the issue.



**Before this pull request:**
(Screenshot taken from https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.add.html)
<img width="856" alt="image" src="https://user-images.githubusercontent.com/122238526/211251882-8bebd9f1-17bd-41f9-93bb-14e81620981a.png">




**After this pull request:**
(Screenshot taken from docs built locally)
<img width="849" alt="image" src="https://user-images.githubusercontent.com/122238526/211251773-35d73066-5537-4b74-9f6e-d8e750bfcfb4.png">




Labels:
name: Docs

Comments:
Hi all - first-timer here.  Thanks for reviewing and for any feedback!
thx @smij720
BUG: groupby with empty object, categorical grouper, and dropna=False fails
State: closed

- [x] closes #50634 (Replace xxxx with the GitHub issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Bug
name: Groupby
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Categorical
description: Categorical Data Type

Comments:
LGTM pending CI ✅ 
Thanks @rhshadrach
REF/PERF: ArrowExtensionArray.__setitem__
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.0.rst` file if fixing a bug or adding a new feature.

Simplifies and improves performance of `ArrowExtensionArray.__setitem__` via more use of pyarrow compute functions and less back and forth through numpy.

ASVs:
```
        before           after         ratio
    [059b2c18]       [91049c37]
    <main>           <arrow-setitem>
-         382±2μs          336±1μs     0.88  array.ArrowStringArray.time_setitem_list(False)
-         900±5μs         566±10μs     0.63  array.ArrowStringArray.time_setitem_list(True)
-      14.0±0.3ms      6.12±0.06ms     0.44  array.ArrowStringArray.time_setitem(False)
-         345±6μs        99.6±20μs     0.29  array.ArrowStringArray.time_setitem_slice(False)
-      24.5±0.2ms      6.12±0.05ms     0.25  array.ArrowStringArray.time_setitem(True)
-     5.35±0.06ms          304±3μs     0.06  array.ArrowStringArray.time_setitem_slice(True)
```


Labels:
name: Refactor
description: Internal refactoring of code
name: Performance
description: Memory or execution speed performance
name: Arrow
description: pyarrow functionality

Comments:
Not for this PR but because I'm cranky: the fact that we have to implement a kludgy `__setitem__` sucks.  ideally pyarrow would implement it; failing that better to set into each of the elements of `self._data.buffers()` (which besides being a PITA im not sure is even possible in mask-less cases)
> Not for this PR but because I'm cranky: the fact that we have to implement a kludgy `__setitem__` sucks. ideally pyarrow would implement it; failing that better to set into each of the elements of `self._data.buffers()` (which besides being a PITA im not sure is even possible in mask-less cases)

This was a (failed?) attempt to make it a little less kludgy :). Agreed its still kludgy. 

Part of the complexity is supporting older versions of pyarrow where the pyarrow.compute functions have bugs we need to work around. We could remove the fast paths if simplicity is preferred.

I'm not familiar with the buffers but could take a look. 
> I'm not familiar with the buffers but could take a look.

Definitely don't put time into this on my account.  I've got a bug in my bonnet about preserving views (xref #45419) that becomes less important with CoW.  Plus as mentioned, im not confident that the buffers() approach is even feasible.
Thanks @lukemanley
CLN: Consolidate groupby.value_counts 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.

No test changes, just a move.


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Groupby
name: Algos
description: Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
name: Clean

Comments:
Thanks @rhshadrach
BUG: Fix bug in putmask for CoW
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
- [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.

cc @jorisvandenbossche this did not work an 1.5.2

Labels:
name: Copy / view semantics

Comments:
cc @jorisvandenbossche Could you have a quick look? Ideally this would go into 1.5.3
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 1.5.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 954cf55938c50e34ddeced408d04bd04651eb96a
```

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

```
git commit -am 'Backport PR #50630: BUG: Fix bug in putmask for CoW'
```

4. Push to a named branch:

```
git push YOURFORK 1.5.x:auto-backport-of-pr-50630-on-1.5.x
```

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

> "Backport PR #50630 on branch 1.5.x (BUG: Fix bug in putmask for CoW)"

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).
                
Should we backport https://github.com/pandas-dev/pandas/pull/50675 as well?
Ah, forget what I said, the usage of `using_copy_on_write` is in the internals itself, so there it is fine as is.
Puuuuh, is there anything else that is scheduled for 1.5.3 regarding CoW? If not, I wouldn't backport I think
Good :)
REGR: NumPy func warning when dropping nuisance in agg, apply, transform
State: closed

- [x] closes #50538 (Replace xxxx with the GitHub issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Regression
description: Functionality that used to work in a prior pandas version
name: Apply
description: Apply, Aggregate, Transform, Map
name: Warnings
description: Warnings that appear or should be added to pandas
name: Nuisance Columns
description: Identifying/Dropping nuisance columns in reductions, groupby.add, DataFrame.apply

Comments:
@jorisvandenbossche @jbrockmendel @mroeschke for any thoughts/feedback
In case we keep the current behaviour (no special handling of `numeric_only`, just passing through), then this is at least a clear improvement in the warning messages!
@jorisvandenbossche - I think trying to change the pass through behavior is too tricky for a patch (this is targeted to go straight into 1.5.3). I do plan to work on it for future versions (e.g. #50624). If you want this to not close #50538, I can remove it from the OP here, but I do think this is the safest route for 1.5.3.
@mroeschke - friendly ping.
Thanks @rhshadrach
PDEP6 implementation pt 1: block.setitem, block.putmask
State: closed

This is pt 1. More changes would be needed to fully complete PDEP6 (`eablock.setitem` and `eablock.putmask` for a start), but I'd suggest that we do this in stages. This PR is already pretty big

some of this can be factored out, I'll do that first

pt2: https://github.com/pandas-dev/pandas/pull/53405

Labels:
name: API Design

Comments:
@jbrockmendel gentle ping, just to ask if you think this would be the right direction / the right place to raise the warning. I think there would need to be at least 4 such PRs to address the initial scope of PDEP6
> the right place to raise the warning

Looks right to me
🤔 this is still raising a warning for
```python
s = pd.Series([1, 2, 3])
s.update(pd.Series([4, np.nan, 6]))
print(s)
```
, looking into it

EDIT: done!
yeah I've factored out into separate PRs what I could, but I'll see if I can do more
> Do we have tests where this will warn when setting an EA type value?

There's some tests here for when setting an incompatible value raises there: pandas/tests/arrays/masked/test_indexing.py . I'll adapted them for numpy dtypes, thanks
9/21 files viewed!  Getting there...
small comments, otherwise LGTM
Looks pretty good to me too. 

Should this have a whatsnew note for 2.1? And is it okay if not all of PDEP6 changes don't make it into 2.1?
Thanks!

I think ideally this and https://github.com/pandas-dev/pandas/pull/53405 should go together, either both in 2.1 or both in 2.2

Whatsnew - #54014 introduces a section for notable deprecations, shall I add it to that once that's merged?
Or I can add it as part of #53405 
Probably best if the whatsnew is added in https://github.com/pandas-dev/pandas/pull/53405 then. Is that PR pretty close?
yeah it should be ready, I just need to rebase it after this one - but it doesn't look like there's too many conflicts to resolve fortunately
Thanks @MarcoGorelli 
nice!
BUG: Tuple subclasses should work as tuple in `df.iloc[key]`
State: closed

- Closes #48188
- [ ] [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 an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

---

This patch makes tuple subclasses behave the same as tuple in `df.iloc[key]` and `df.loc[key]`.  All but one of the tests pass.  The failing test (`indexing/test_loc.py::TestLocBaseIndependent::test_loc_getitem_index_namedtuple`) raises an exception on `df.loc[key]` (not `.iloc`).  I've opened issue #50597 where I suggest deprecating the behavior in that test.  This patch would enforce that deprecation in addition to closing #48188.

I'm opening this as is WIP but please comment.  I have doubts on whether I'm on the right track with this.


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.
PERF: groupby.any/all with object dtype
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.0.rst` file if fixing a bug or adding a new feature.


```
from asv_bench.benchmarks.groupby import GroupByMethods

params = dict(dtype="object", method="all", application="direct", ncols=1) 

b = GroupByMethods()
b.setup(**params)

%timeit b.time_dtype_as_field(**params)

# 881 µs ± 20.2 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)  -> main
# 216 µs ± 1.15 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)  -> PR
```

Labels:
name: Groupby
name: Performance
description: Memory or execution speed performance

Comments:
Thx @lukemanley
ENH: guess ISO8601 formats without separators
State: closed

- [ ] closes #50514 (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: Enhancement
name: Datetime
description: Datetime data dtype

Comments:
Is there anything user-facing that gets a boost (`whatsnew`) from this?  Otherwise, LGTM.
thanks - not yet, this'll make a user-facing since PDEP4 (in which `to_datetime` always attempts to guess the format and to parse consistently)
Thanks @MarcoGorelli
CLN avoid more test warnings
State: closed

Similar to https://github.com/pandas-dev/pandas/pull/50493

There are places when an implicit cast happens, but it's not the purpose of the test - the cast might as well be done explicitly then

This would help pave the way towards https://github.com/pandas-dev/pandas/pull/50424

---

I expect this to be the last precursor PR, after this one I'll raise a draft PR to try enforcing PDEP6 in some cases (note that merging would only take place _after_ 2.0 is released)

Labels:

Comments:
thx @MarcoGorelli
PERF: IntervalArray.from_tuples
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.0.rst` file if fixing a bug or adding a new feature.

```
from asv_bench.benchmarks.array import IntervalArray

b = IntervalArray()
b.setup()

%timeit b.time_from_tuples()

22.7 ms ± 1.35 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  -> main
3.32 ms ± 268 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)  -> PR
```

Labels:
name: Performance
description: Memory or execution speed performance
name: Interval
description: Interval data type

Comments:
thx @lukemanley
ENH: CoW Replace
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.

Sits on top of #50148. (will rebase afterwards).


Labels:

Comments:
@phofl I think I got this to work now, let me know if this approach is correct.
ENH: DTI/TDI as_unit
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: Enhancement
name: Timestamp
description: pd.Timestamp and associated methods

Comments:
> I just don't really follow the note on supported resolutions - should non-supported ones raise?

good catch, will fix.
CLN/BUG: Allow assert_produces_warning to raise during an exception
State: closed

Fixes this case that would not raise an `AssertionError` before

```
with pytest.raises(...):
    with tm.assert_produces_warning(UserWarning):
        raise ...
```

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

Comments:
CI/CD notwithstanding, I'm having some trouble reviewing this PR.  It seems there are changes beyond the scope of the title?

IMO could benefit from breaking apart into smaller ones unless I'm missing something @mroeschke.
There is an attribute cleanup and doc change in this PR, but otherwise the other changes correspond to `assert_produces_warning` now evaluating during exceptions. The changed tests have stale `assert_produces_warning`s that are testing that an exception is raised
PERF: BooleanArray._from_sequence_of_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.0.0.rst` file if fixing a bug or adding a new feature.

Also removes the need to xfail when parsing a pyarrow array of strings.

```
import pandas as pd
import numpy as np
from pandas.core.arrays.boolean import BooleanArray

choices = BooleanArray._TRUE_VALUES.union(BooleanArray._FALSE_VALUES)
choices = np.array(list(choices), dtype=object)
strings = np.random.choice(choices, 10**5, replace=True)

%timeit BooleanArray._from_sequence_of_strings(strings)

# 43.4 ms ± 1.04 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  -> main
# 21.9 ms ± 120 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)   -> PR

Labels:
name: Performance
description: Memory or execution speed performance

Comments:
thx @lukemanley
BUG/ENH: infer_freq with non-nano
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: Enhancement
name: Frequency
description: DateOffsets

Comments:
Thanks @jbrockmendel
REGR: Fix regression in to_numpy
State: closed

- [x] closes #50600 (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.

cc @mroeschke 

Labels:
name: Bug
name: Regression
description: Functionality that used to work in a prior pandas version

Comments:
Thanks @phofl
CLN More float warnings
State: closed

Similar to https://github.com/pandas-dev/pandas/pull/50493

There are places when an implicit cast happens, but it's not the purpose of the test - the cast might as well be done explicitly then

This would help pave the way towards https://github.com/pandas-dev/pandas/pull/50424

Labels:
name: Clean

Comments:
thx @MarcoGorelli
DOC: add example to Interval.mid docstring
State: closed

- [x] xref #15580 (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
name: Interval
description: Interval data type

Comments:
Thanks @abonte