BrandonFors/pandas-github-issues huggingface dataset:
Fix docs for api.types
State: closed

The following PR is related to: https://github.com/pandas-dev/pandas/issues/58577
and fixes the below doc issues:
```
        -i "pandas.api.types.is_bool PR01,SA01" \
        -i "pandas.api.types.is_categorical_dtype SA01" \
        -i "pandas.api.types.is_complex PR01,SA01" \
        -i "pandas.api.types.is_complex_dtype SA01" \
        -i "pandas.api.types.is_datetime64_dtype SA01" \
        -i "pandas.api.types.is_datetime64_ns_dtype SA01" \
        -i "pandas.api.types.is_datetime64tz_dtype SA01" \
```

Labels:
name: Docs

Comments:
Thanks @abhinav-thimma
DEPR: Update groupby.apply DeprecationWarning to FutureWarning
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.

Ref: https://github.com/pandas-dev/pandas/pull/54950#issuecomment-1896995028

Labels:
name: Groupby
name: Apply
description: Apply, Aggregate, Transform, Map
name: Warnings
description: Warnings that appear or should be added to pandas

Comments:
Just got caught up with some of the chat on slack, marking this as a draft until https://github.com/pandas-dev/pandas/pull/59513 is merged.
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.
I also assume we discussed the actual deprecation thoroughly before, and then +1 on updating it from DeprecationWarning to FutureWarning now.
@rhshadrach can you add a brief whatsnew note for 2.3 (maybe just linking to the earlier whatsnew note about it). Users might still start seeing this when updating to 2.3, so it would be good to have some mention of it.
Thanks @rhshadrach
BUG: Fix groupby().any() behavior for timedelta columns with all null valuesfix issue #59712
State: closed

This pull request addresses a bug in the `groupby().any()` method when applied to DataFrames with `timedelta` columns where all values are null (`NaT`). Previously, the method incorrectly returned `True` for groups with all null values in the `timedelta` column. 

**Changes Made:**
- Updated the `_call_cython_op` method to correctly handle `timedelta` columns when computing the `any()` aggregation.
- Added a new test case to verify that `groupby().any()` returns `False` for groups where all `timedelta` values are null.

**Issue Reference:**
- See issue [#59712](https://github.com/pandas-dev/pandas/issues/59712) for more details about the bug report.

This fix ensures that the `groupby().any()` method behaves consistently for `timedelta` columns, aligning with the behavior observed for other data types.


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

Comments:
Thanks for the PR!

> * Added a new test case to verify that `groupby().any()` returns `False` for groups where all `timedelta` values are null.

Not seeing a new test. Perhaps you didn't commit it?

> Thanks for the PR!
> 
> > * Added a new test case to verify that `groupby().any()` returns `False` for groups where all `timedelta` values are null.
> 
> Not seeing a new test. Perhaps you didn't commit it?

Yeah. sorry. i did now
@40gilad - in case you didn't notice, tests on the CI are failing. Let me know if you could use an assistance.
@rhshadrach - can I take over this issue? seems like this PR has gone stale
Agreed at @KevsterAmp - but there was already another open PR on this (#59782). I'd suggest giving that PR a few weeks, and if it goes stale, you're next up. Sound reasonable?
Sounds good to me. Thanks
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.
The other PR was merged. Closing.
TST: Update IntervalArray min/max test to fail on changed default skipna
State: closed

- [x] Part of #58517 
- [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.~ Not applicable
- [x] ~Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.~ Not applicable

Before, if the line [core/arrays/interval.py:866](https://github.com/pandas-dev/pandas/blob/v2.2.1/pandas/core/arrays/interval.py#L866) is changed from `def min(self, *, axis: AxisInt | None = None, skipna: bool = True) -> IntervalOrNA:` to `def min(self, *, axis: AxisInt | None = None, skipna: bool = False) -> IntervalOrNA:`, all tests still passed. Now they will fail if the default `skipna` param is updated, perhaps mistakenly.

Applies to `max()` method too since they are tested in the same test function.

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

Comments:
@mroeschke Could you take a look? Thank you!
Thanks @jsngn
Enhanced Test Fixtures for Comprehensive Data Frame Testing: More on Mixed Types, Time zones and More 
State: closed

 Testing of various Data Frame operations and manipulations is now enhanced by a rich set of fixtures designed for various use cases. 
 
 This is because this fixture is very vital in testing of functions that involve time-based indexing and date manipulation. It is a random float generator with the values of which are indexed by the business dates thus making it possible to simulate the real-time data processing. 
 


This fixture has a column of strings together with numerical values in it, to serve the purpose of a data type with string and numeric column. The Data Frame has a unique string index and an additional column which contains a constant string “bar” to test string operations and check the stability. 
This setup allows to test how various float precision and their conversions are being dealt with in Data Frames for proper calculations and types management. 
 
 This fixture is quite essential when testing operations that involve different integer types and integer-related calculations. 
 
It is especially helpful in testing time zone conversion and handling of missing data so that the time-based data gets processed properly in all the time zones. 
 
 


- [ ] 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:
Going to assume this was AI generated like https://github.com/fastai/fastai/pull/4048. Closing
API: value_counts to consistently maintain order of input
State: closed

- [x] closes #59307 (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.

Context is here: https://github.com/pandas-dev/pandas/issues/59307#issuecomment-2277024300

Labels:
name: Algos
description: Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
name: API - Consistency
description: Internal Consistency of API/Behavior

Comments:
Thanks @rhshadrach 
This broke the following case:

```
df = pd.DataFrame({"a": [1, 2, 1, 2], "b": np.nan})
df.groupby("a").value_counts()
```

with

```
Traceback (most recent call last):
  File "/Users/patrick/Library/Application Support/JetBrains/PyCharm2024.1/scratches/scratch_1.py", line 100, in <module>
    df.groupby("a").value_counts()
  File "/Users/patrick/mambaforge/envs/dask-expr/lib/python3.12/site-packages/pandas/core/groupby/generic.py", line 2723, in value_counts
    return self._value_counts(subset, normalize, sort, ascending, dropna)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/patrick/mambaforge/envs/dask-expr/lib/python3.12/site-packages/pandas/core/groupby/groupby.py", line 2535, in _value_counts
    result_series = cast(Series, gb.size())
                                 ^^^^^^^^^
  File "/Users/patrick/mambaforge/envs/dask-expr/lib/python3.12/site-packages/pandas/core/groupby/groupby.py", line 2747, in size
    result = self._grouper.size()
             ^^^^^^^^^^^^^^^^^^^^
  File "/Users/patrick/mambaforge/envs/dask-expr/lib/python3.12/site-packages/pandas/core/groupby/ops.py", line 696, in size
    ids = self.ids
          ^^^^^^^^
  File "/Users/patrick/mambaforge/envs/dask-expr/lib/python3.12/site-packages/pandas/core/groupby/ops.py", line 750, in ids
    return self.result_index_and_ids[1]
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "properties.pyx", line 36, in pandas._libs.properties.CachedProperty.__get__
  File "/Users/patrick/mambaforge/envs/dask-expr/lib/python3.12/site-packages/pandas/core/groupby/ops.py", line 769, in result_index_and_ids
    result_index, ids = self._ob_index_and_ids(
                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/patrick/mambaforge/envs/dask-expr/lib/python3.12/site-packages/pandas/core/groupby/ops.py", line 884, in _ob_index_and_ids
    ob_ids = np.where(ob_ids == -1, -1, index.take(ob_ids))
                                        ^^^^^^^^^^^^^^^^^^
IndexError: cannot do a non-empty take from an empty axes.
```
Doc string for pandas.Timestamp.max, pandas.Timestamp.min
State: closed

Context in https://github.com/pandas-dev/pandas/issues/59458

Addressed:
- pandas.Timestamp.max
- pandas.Timestamp.min

Changes done:

- Added docstring for the above
- Added an attribute section

Labels:

Comments:
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
BUG: Remove `read_json` datetime deprecation warning
State: closed

- [x] closes #59511 (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.
- [ ] 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:
CIs are failing, not sure if this is the right target branch to open a PR
@lithomas1 - am I right in guessing that there is likely not to be any more releases from the `2.2.x` branch? If that's the case, this PR should target `2.3.x`.

@KevsterAmp - CI issues are likely temporary.
Gotcha, retargeting to branch 2.3.x
@rhshadrach - moved it to 2.3.x. Do I need to add any other changes here? Thanks
@KevsterAmp - can you merge main to kick off the CI again
@KevsterAmp - looks like the CI failures are related.
Oops, merged the wrong branch
DOC: Fix SA01 for pandas.Series.dt.nanoseconds and pandas.Series.dt.seconds.
State: closed

Adds See Also & Extended Summary for:
`pandas.Series.dt.seconds`
`pandas.Series.dt.nanoseconds`

Labels:

Comments:
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
It seems that someone else has already merged my changes to the main branch :( I will look into other ways i can contribute to the project! Much appreciated.
DOC: move `idxmin` and `idxmax` docs from core/shared_docs.py to core/frame.py
State: closed

xref #59726
The shared docs for `idxmin` and `idxmax` are used only in the class `DataFrame`. `Series.idxmin/idxmax` and `core.groupby.SeriesGroupBy.idxmin/idxmax `have their own docstrings.

I moved the `idxmin` and `idxmax` docstrings from `shared_docs.py` to `core/frame.py` and  corrected the description of `skipna` parameter.


Labels:
name: Docs

Comments:
Thanks @natmokval
test 1 xav
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:
sorry my bad
DOC: Clarify docs for df.to_sql
State: closed

- [ ] closes #35891
- [ ] [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 @deekapila 
Thanks to you @WillAyd
BUG (string): Series.str.slice with negative step
State: closed

- [x] closes #59710 (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: Strings
description: String extension data type and string data
name: backported

Comments:
If something fails for older version of pyarrow, can we instead fallback to the python implementation for that version of pyarrow? (instead of failing for the user, i.e. skipping that in the tests)
And while we are touching those methods, move it to the mixin at once as well?
> If something fails for older version of pyarrow, can we instead fallback to the python implementation for that version of pyarrow? (instead of failing for the user, i.e. skipping that in the tests)

just tried that and it broke the min versions test, looks like it is getting an int64 dtype somehow.  just restored the xfail.
Sorry, I don't understand how that can let those tests fail to use our long-used object dtype implementation. What was the error you got?  
FWIW it would help in reviewing if you pushed additional commits instead of reverting/force pushing, then it is clearer what you actually tried and what the CI said
> Sorry, I don't understand how that can let those tests fail to use our long-used object dtype implementation. What was the error you got?

will re-restore the fallback to find out.

> FWIW it would help in reviewing if you pushed additional commits instead of reverting/force pushing, then it is clearer what you actually tried and what the CI said

ive been rebasing (instead of merging main like usual) on the theory it would make backporting easier.  if that theory is mistaken, ill go back to the usual system.



> ive been rebasing (instead of merging main like usual)

Also when you add new commits for any change you make, you can still use rebase instead of merge to update with the latest main, if you prefer that

> on the theory it would make backporting easier.

PRs are always squashed into a single commit on top of main when merging, so I don't think this has any impact on backporting ease
Just pushed one small additional case that wasn't covered yet (one that was failing before with StringDtype as well)
Thanks!
Fix part of docstring timedelta #59698
State: closed

Part of [59698](https://github.com/pandas-dev/pandas/issues/59698)

Addresses:

pandas.Timedelta

Added the missing explanations (PRO2) for min, max, and resolution.

Removed:

-  i "pandas.Timedelta.resolution PR02" \
-  i "pandas.Timedelta.min PR02" \
-  i "pandas.Timedelta.resolution PR02" \

from code_checks.sh

p.s. I'm not 100% confident if this is the appropriate way to document these attributes. That said, they're being defined by a class called `MinMaxReso`, and they don't have their separate definitions per se. So, I found this most appropriate way to document them.

Labels:

Comments:
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
BUG: CSS strings truncated at ":"
State: closed

Fixes issue #59623 

Changes `maybe_convert_css_to_tuples` called by `style.map()` so that it no longer truncates the CSS-value at the ":". 

e.g. `background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-dk" viewBox="0 0 640 480"><path fill="%23c8102e" d="M0 0h640.1v480H0z"/><path fill="%23fff" d="M205.7 0h68.6v480h-68.6z"/><path fill="%23fff" d="M0 205.7h640.1v68.6H0z"/></svg>');` will no longer be truncated to the tuple `("background-image" ,  "url('data:")`



Labels:
name: Styler
description: conditional formatting using DataFrame.style

Comments:
needs a unit test to demonstrate it solves the test
@attack68 the failing test seems unralated to my change? I'm not sure how to proceed.


The pre-commit.ci is failing but I'm not sure how to fix. I think it fails due to this string.

```python
msg = (
	"Styles supplied as string must follow CSS rule formats, "
	"for example 'attr: val;'. 'err' was given."
)
```
`ruff format` failed. This means you need to install ruff and run `ruff format` in terminal **on your file**. It will edit it according to specifications, i.e. it might remove some whitespace or dangling commas etc.
> `ruff format` failed. This means you need to install ruff and run `ruff format` in terminal **on your file**. It will edit it according to specifications, i.e. it might remove some whitespace or dangling commas etc.

Thanks. It looks good now I think :)
Thanks. LGTM.
This is a nice fix for the issue, although we acknowledge we can't go further without a proper CSS parser.
Thanks @invalidarg
DOC: Fix some docstring validation errors #59698
State: closed

Part of an effort to close #59698

Added missing "See Also" section to the following methods:
```python
pandas.TimedeltaIndex.components
pandas.TimedeltaIndex.microseconds
```
and updated undocumented parameters for the following method:
```python
pandas.Timedelta.to_numpy
```
Removed the following strings from `code_checks.sh`:
```python
 -i "pandas.Timedelta.to_numpy PR01" \ 
 -i "pandas.TimedeltaIndex.components SA01" \ 
 -i "pandas.TimedeltaIndex.microseconds SA01" \
```


Labels:
name: Docs

Comments:
Thanks @amanlai 
@amanlai - just as a note, if you have "close" on the same line as an issue number, GitHub will automatically close the issue when your PR is merged. Best to just have something like "Part of #XXXXXX".
REF (string): de-duplicate _str_contains
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: Strings
description: String extension data type and string data
name: backported

Comments:
Thanks @jbrockmendel
TST: Update BooleanArray _logical_method test to fail on incorrect length comparison operator
State: closed

- [x] Part of #58517 
- [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.~ Not applicable
- [x] ~Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.~ Not applicable

Before, if the line [core/arrays/boolean.py:379](https://github.com/pandas-dev/pandas/blob/v2.2.1/pandas/core/arrays/boolean.py#L379) is changed from `if not other_is_scalar and len(self) != len(other):` to `if not other_is_scalar and len(self) > len(other):`, all tests still passed. Now they will fail if the comparison operator is changed to `>`.

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

Comments:
@mroeschke Could you take a look? Thank you!
Thanks @jsngn
Fix part of docstring timedelta index#59698
State: closed

Part of #59698

Addresses:
pandas.TimedeltaIndex

Added missing 'See Also' sections (SA01) for the following methods:

- pandas.Timedelta.ceil
- pandas.Timedelta.floor
- pandas.Timedelta.asm8
- pandas.Timedelta.round

Removed:

- -i "pandas.Timedelta.asm8 SA01" \
- -i "pandas.Timedelta.ceil SA01" \
- -i "pandas.Timedelta.floor SA01" \
- -i "pandas.Timedelta.round SA01" \

from code_checks.sh

Labels:
name: Docs

Comments:
Thanks @uditbaliyan