BrandonFors/pandas-github-issues huggingface dataset:
BUG: added fix for column index for DatetimeIndex type
State: closed

- [ ] closes #60273 (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.

Added fix in pandas/core/generic.py by adding the lines below to the take() method within core/generic.py, which is called in the getitem method in core/frame.py in order to the columns as objects.

```
        if axis == 1 and indices.ndim == 1 and is_range_indexer(indices, len(self.columns)):
            # check if index is of type period, sets to object for slicing correct columns
            if isinstance(self.index, DatetimeIndex) or isinstance(self.index, PeriodIndex): 
                return self.copy(deep=False).astype('object')
            return self.copy(deep=False)
```

The method was not properly returning the right columns if the datatype was a DatetimeIndex or PeriodIndex. Added tests in pandas/tests/series/indexing/test_getitem.py to reflect these changes.  

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: Fix `ListAccessor` methods to preserve original name
State: closed

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


Labels:
name: Series
description: Series data structure
name: Arrow
description: pyarrow functionality

Comments:
thanks @FBruzzesi - this would go in 3.0
Thanks @FBruzzesi
Update frame.rst
State: closed

Fix the navigation bar

- [ ] closes #60492  (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.

pandas.DataFrame.head and pandas.DataFrame.tail appear twice in the navigation bar, and they jump to the same location.


Labels:
name: Docs

Comments:
Thanks @easternsun7
DOC: fix broken link in Resampler.bfill
State: closed

It's weird that the trailing `)` was not included after rendering, causing the link broken.

![ref](https://github.com/user-attachments/assets/c294042b-23d6-452a-8d0a-c64783e9d1ae)


- [ ] 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:
/preview
Thanks @yuanx749
#Duplicated names in concatenation
State: closed

- [ ] closes #60504
- [ ] [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:
I am not sure if this functionality should be a private method in the Index class. 

Let me know what you think ?

Thanks for the PR, but as mentioned at the issue since there are alternatives there is no enhancement needed here so closing
Add extended summary for fullmatch, match, pad, repeat, slice and slice_replace
State: closed

Added extended summary (ES01) of below methods:

```
-i "pandas.Series.str.fullmatch" \
-i "pandas.Series.str.match" \ 
-i "pandas.Series.str.pad" \
-i "pandas.Series.str.repeat" \
-i "pandas.Series.str.slice" \
-i "pandas.Series.str.slice_replace" \
```

Labels:
name: Docs

Comments:
Thanks @Nanashi-bot
BUG: Fix multi-index on columns with bool level values does not roundtrip through parquet
State: closed

- [x] closes #60508  (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).
- [x] Added an entry in the latest `doc/source/whatsnew/v3.0.0.rst` file if fixing a bug or adding a new feature.


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: Preserve timezone in numpy_dtype for ArrowDtype
State: closed

- [x] closes #60237
- [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
* Added tests in pandas/tests/dtypes/test_dtypes.py to ensure numpy_dtype preserves timezone information for ArrowDtype.
- [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.
* Type annotations are already present in the modified numpy_dtype function.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.
* Added a note in the bug fixes section: `- Fixed an issue where .convert_dtypes(dtype_backend="pyarrow") would strip timezone information from timezone-aware PyArrow timestamps. [GH#60237](https://github.com/pandas-dev/pandas/issues/60237)
`



Labels:
name: Stale

Comments:
pre-commit.ci autofix
pre-commit.ci autofix
pre-commit.ci autofix
pre-commit.ci autofix
pre-commit.ci autofix
pre-commit.ci autofix
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.
DOC: Add hyperlink to ndarray.size in DataFrame.size docstring (#60368)
State: closed

- [x] closes #60368 

This PR addresses issue #60368 by adding a hyperlink to the "See Also" section of the docstring for DataFrame.size.

- Updated the "See Also" section to include a clickable link to `ndarray.size`.

Let me know if any additional changes are needed!


Labels:
name: Docs

Comments:
Thanks @johnpaulfeliciano98
BUG: Fix float32 precision issues in pd.to_datetime
State: closed

- [x] closes #60506(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 an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
Thanks @snitish
DOC: fix docstrings validation for pandas.core.groupby.DataFrameGroupBy.boxplot
State: closed

Part of Issue #60365

Fixed docstring validation for pandas.core.groupby.DataFrameGroupBy.boxplot

The following errors were addressed:

- PR07    Parameter "grouped" has no description
- PR07    Parameter "fontsize" has no description
- PR07    Parameter "rot" has no description
- PR07    Parameter "grid" has no description
- PR07    Parameter "ax" has no description
- PR07    Parameter "figsize" has no description
- RT03    Return value has no description
- RT03    Return value has no description
- SA01    See Also section not found


Labels:
name: Docs

Comments:
Thanks @jmalp
doc: update dsintro.rst to remove a warring
State: closed

To solve a warning in issue DOC: DeprecationWarning on "Intro to data structures" user guide #60490. 
I have checked other parts of the page, and there are no such warnings.

issue url:  [https://github.com/pandas-dev/pandas/issues/60490](url)

closes #60490

Labels:
name: Docs

Comments:
Thanks @asdkfjsd
BUG: Fix bug in GroupBy that ignores group_keys arg for empty datafra…
State: closed

…mes/series

- [x] closes #60471(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 an entry in the latest `doc/source/whatsnew/v3.0.0.rst` file if fixing a bug or adding a new feature.

When using `groupby.apply` on an empty dataframe or series with `group_keys=False`, the output index is incorrectly set to the grouping keys, while it is expected to be a `RangeIndex(0, 0, 1)`.
From the original issue:
```
>>> df = pd.DataFrame({'A': [], 'B': [], 'C': []})
>>> g2 = df.groupby('A', group_keys=False)
>>> r2 = g2.apply(lambda x: x / x.sum())
>>> print(r2.index)
Index([], dtype='float64', name='A')
```
Expected:
```
>>> print(r2.index)
RangeIndex(start=0, stop=0, step=1)
```

Labels:
name: Groupby
name: Apply
description: Apply, Aggregate, Transform, Map

Comments:
Thanks @snitish
DOC: Fix some core.resample.Resampler docstrings
State: closed

Similar to issues #59698, #59592, and #59458.

Fixes: 
```text
-i "pandas.core.resample.Resampler.max PR01,RT03,SA01" \
-i "pandas.core.resample.Resampler.mean SA01" \
-i "pandas.core.resample.Resampler.min PR01,RT03,SA01" \
-i "pandas.core.resample.Resampler.prod SA01" \
-i "pandas.core.resample.Resampler.std SA01" \
-i "pandas.core.resample.Resampler.var SA01" \
```

All docstrings are now only showing ES01 as missing, which according to code_checks.sh line 71, is okay.

Labels:
name: Docs
name: Resample
description: resample method

Comments:
pre-commit.ci autofix
@knowltod - can you merge main and resolve the conflict
Thanks @knowltod
BUG: added support for ordered categoricals in kendall/spearman correlation
State: closed

- [x] closes #60306
- [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.

This adds support for Kendall and Spearman correlation on **ordered** categorical data - no change in behaviour for Pearson correlation or for unordered categoricals.

As shown in the bug report
```python
df = DataFrame({'a' : [1, 2, 3, 4], 'b' : [4, 3, 2, 1]})
df['b'] = df['b'].astype('category').cat.set_categories([4, 3, 2, 1], ordered=True)
df.corr(method='spearman')
```
used to return -1, going forward this will return 1. I.e. this does not try to convert the categories to floats, but instead uses the stated order of each category. 



Labels:
name: Stale

Comments:
Tests used to pass - freethreading started segfaulting after I changed the .rst file - Highly doubt this is a problem with the PR
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.
Let me know if there's anything I can do to improve this - the failing tests seem to fail at the build stage, or anyway before any actual test is run.
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: Fix read_csv MultiIndex empty value handling (#59560)
State: closed

- [x] closes #59560 (Fixes inconsistency in `read_csv` handling of MultiIndex with empty values)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests)  
      Added `test_multiindex_empty_values_handling` in `pandas/tests/io/parser/test_index_col.py` to validate that `read_csv` correctly handles MultiIndex with empty values, leaving them as empty strings instead of replacing them with `"Unnamed: ..."`.  
      All relevant tests passed successfully.
- [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/v3.0.0.rst` file if fixing a bug or adding a new feature.  
      Updated the `MultiIndex` section with the following entry:
      
      ```rst
      - :func:`read_csv` now properly handles MultiIndex with empty values by leaving them as empty strings, ensuring consistency in index and column handling (:issue:`59560`).
      ```



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.
DOC: Fix PR02 errors in Timedelta attributes (min, max, resolution) d…
State: closed


Part of #59698 
 

Addresses:

pandas.Timedelta

Added the missing explanations (PRO2) for min, max, and resolution.

Removed from code_checks.sh

i "pandas.Timedelta.resolution PR02" \
i "pandas.Timedelta.min PR02" \
i "pandas.Timedelta.resolution PR02" \


Labels:

Comments:
thanks for your pr, looks like there's some issues
```
/home/runner/micromamba/envs/test/lib/python3.10/site-packages/numpydoc/docscrape.py:203: UserWarning: potentially wrong underline length... 
Returns 
-------- in 

Return utc offset.... in the docstring of utcoffset
  while not self._is_at_section() and not self._doc.eof():
/home/runner/micromamba/envs/test/lib/python3.10/site-packages/numpydoc/docscrape.py:203: UserWarning: potentially wrong underline length... 
Examples 
------------ in 

Check whether all characters in each string are titlecase.... in the docstring of istitle in /home/runner/work/pandas/pandas/pandas/core/strings/accessor.py.
  while not self._is_at_section() and not self._doc.eof():
Error: None:None:PR02:pandas.Timedelta.max:Unknown parameters {'value', 'unit', '**kwargs'}
Error: None:None:PR02:pandas.Timedelta.min:Unknown parameters {'value', 'unit', '**kwargs'}
Error: None:None:PR02:pandas.Timedelta.resolution:Unknown parameters {'value', 'unit', '**kwargs'}
```
I will take any suggestions on how to deal with those unknown parameters, as I have exhausted all possible ideas. I am not sure that the min, max, and Resolution are good to be tagged with the "good first issue". 
Can the ignores be left in code_checks.sh and still have it update the documentation? 
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
DOC: Fix some docstring validations in pd.Series
State: closed

Partially addresses #59592 

Fixes:
```
-i "pandas.Series.dt.unit GL08" \
-i "pandas.Series.pad PR01,SA01" \
```

- I have documented `pandas.Series.dt.uni`
- The docstring for `pandas.Series.pad` is unecesary as it even fails on the docstring check:

![image](https://github.com/user-attachments/assets/20e7d0de-1f7c-452c-98b0-fda0db679e98)



Labels:
name: Docs

Comments:
Thanks @OscarGB
Adds See Also sections to pandas.core.groupby.DataFrameGroupBy.sem, pandas.core.groupby.DataFrameGroupBy.nunique
State: closed

- [x] Part of issue #60365 
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Labels:
name: Docs

Comments:
 -i "pandas.core.groupby.DataFrameGroupBy.sem SA01" \ 
 -i "pandas.core.groupby.DataFrameGroupBy.nunique SA01" \ 
Thanks @thedataninja1786
Fix docstring groupby
State: closed

Partially addresses #60365 
Fixes 
```
 -i "pandas.core.groupby.SeriesGroupBy.sem SA01" \ 
```

Labels:
name: Docs
name: Groupby

Comments:
Thanks for the PR! Can you merge main and resolve the conflicts.
@githubalexliu - it looks like the merge has undone your changes. This PR now has no differences from the main branch.
Thanks for the PR, but it appears another user has already addressed this entry in the meantime so closing this PR.

Happy to have your contributions towards other ignored docstring validations in `code_checks.sh`
DOC: Fix docstrings errors SEM and GET_GROUP
State: closed

- [ ] part of https://github.com/pandas-dev/pandas/issues/60365



Labels:
name: Docs
name: Groupby

Comments:
@Axeldnahcram - can you merge main and resolve the conflicts.
@rhshadrach done. I also have a small question. I have had some issues running the formatting/cleaning steps of precommit/linting and I was wondering if we should not include it in the Making a [pull request contribution guideline ](https://pandas.pydata.org/docs/development/contributing.html#id10)
Maybe it is intended ? Or maybe I simply missed a readme/documentation somewhere. Let me know what you think
Thanks @Axeldnahcram
DOC: DataFrameGroupBy.idxmin() returns DataFrame, documentation says Serie
State: closed

- [] closes https://github.com/pandas-dev/pandas/issues/15275
I also fixed the docs for idxmax and introduced a relevant example for both idxmin and idxmax, previous example was not relevant for groupby

Labels:
name: Docs
name: Groupby

Comments:
Thanks @Axeldnahcram
BUG: Preserve Timezone and Higher Resolution in DatetimeIndex.union
State: closed

- [X] closes #60080 (Ensure timezone and resolution are preserved in `DatetimeIndex.union` operations with the same timezone but different units)
- [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:
  - Added `test_union_preserves_timezone_and_resolution`.
  - Added `test_union_different_timezones`.
- [X] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit):
  - Used `pre-commit` hooks for `flake8`, `isort`, and `black`.
- [X] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions:
  - Annotated the resolution comparison logic and ensured clarity for mappings.
- [X] Added an entry in the latest `doc/source/whatsnew/v3.0.0.rst` file if fixing a bug or adding a new feature:
  - Section: **Bug Fixes**
    - Entry: Fixed timezone and resolution preservation in `DatetimeIndex.union`. Previously, `DatetimeIndex.union` would sometimes convert timezone-aware indices with the same timezone but different units to UTC. GH#60080




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.
FIX : Missing 'pickleshare' package when running 'sphinx-build' command
State: closed

- [ ] closes #60429
- [ ] All code checks passed

Add pickleshare requirement in environment.yml and requirements-dev.txt.
I’ve also added the issue number. 

Labels:
name: Build
description: Library building on various platforms
name: Docs

Comments:
Thanks @lfffkh!
BUG: Maintain column order in table method rolling
State: closed

- [x] closes #59666 (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 note to whatsnew/v3.0.0.rst 


Labels:
name: Bug
name: Apply
description: Apply, Aggregate, Transform, Map
name: Window
description: rolling, ewma, expanding

Comments:
Thanks, added note to whatsnew. In general, do we do this even for minor bug fixes?
> In general, do we do this even for minor bug fixes?

Yup, especially if the PR fixed an open Github issue
Thanks @snitish