BrandonFors/pandas-github-issues huggingface dataset:
ENH: Added dict support for `pd.set_option`
State: closed

- [x] closes #61093
- [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: Enhancement
name: API Design

Comments:
Hey @rhshadrach, the original issue has not been triaged yet, but I thought it was a worthwhile enhancement to improve code cleanliness. Please let me know what you think!
> Can you also add the deprecation to the whatsnew.

Breaking an established API—especially for a marginal syntactic improvement—comes with a range of both tangible and intangible costs.

Also, we have the PDEP process that should be used for breaking API changes, even small ones?

A user that needs or wants to use a dictionary could simply do...

```python
d = {"a": 1, "b": 2, "c": 3}
flat_list = [elem for pair in d.items() for elem in pair]
print(flat_list)
# ['a', 1, 'b', 2, 'c', 3]
```

-1
> Also, we have the PDEP process that should be used for breaking API changes, even small ones?

No - https://pandas.pydata.org/pdeps/0001-purpose-and-guidelines.html

> A PDEP (pandas enhancement proposal) is a proposal for a major change in pandas
> Breaking an established API—especially for a marginal syntactic improvement—comes with a range of both tangible and intangible costs.

I find this to be a rough edge in pandas. Is there another package that allows the specification of options/configurations/settings as an iterable of alternating key-value pairs? It seems to me like an odd choice for an API, and one that we can improve by having users supply a data structure that more naturally embodies the key-value relationship.
The -1 is for the deprecation and not the enhancement. A PDEP to cover a deprecation of a single rough edge would be ridiculous.

I posted a question in the issue to further consider the deprecation proposal.
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 @arthurlw
DOC: Add missing period
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
- [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.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Docs

Comments:
Thanks @MartinBraquet
BUG: Added deprecation warning to Timestamp constructor
State: closed

Part of #11953

Added deprecation warning to Timestamp constructor when `ts_input = ""`. 

This addition was motivated by this comment: https://github.com/pandas-dev/pandas/issues/11953#issuecomment-1210981966

- [ ] closes #11953 (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
- [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.
- [ ] 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: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Deprecate
description: Functionality to remove in pandas
name: Stale
name: Timestamp
description: pd.Timestamp and associated methods

Comments:
@rhshadrach should be good now, but let me know if you have any suggested improvements!
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.
Implemented Reviewer Feedback :Followed Dev Docs and Added Test for from_records
State: closed

### Changes Made:
- Followed the guidelines from the Pandas contribution documents to implement the requested changes.
- Added tests for from_records based on the current tests and test structure.

These changes align with the contributions guide as per the Pandas development documentation. Please review and let me know if further adjustments are needed.

Labels:

Comments:
Thanks for the PR, we would prefer for you to continue on your original PR https://github.com/pandas-dev/pandas/pull/61143 rather than opening a new one when addressing feedback, so closing this PR
Fix #61123 with simple doc change
State: closed

- [X] closes #61123 
- [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: Docs

Comments:
Thanks @robertutterback
BUG: Preserve column names in DataFrame.from_records when nrows=0
State: closed

### Description
Updates pandas/core/frame.py to preserve column names in empty DataFrames when nrows == 0. Changed from return Cls() to return Cls(columns=columns).

Closes #61140

### Changes Made
- Modified if nrows == 0 in core/frame.py.
- Added test in tests/frame/test_constructors.py.

### Testing
- Added test case for empty DataFrame column retention.
- Verified locally with pytest.


Labels:
name: Bug
name: IO Data
description: IO issues that don't fit into a more specific label
name: Stale

Comments:
I have updated the PR with the latest changes based on feedback. Please review again.
Looks good! The change in `pandas/core/frame.py` appears to correctly address the issue of preserving column names when using `DataFrame.from_records` with `nrows=0` and an empty iterator. The added test `test_from_records_empty_iterator_with_preserve_columns` in `pandas/tests/frame/test_constructors.py` also looks good and verifies the fix effectively.

One minor point: It looks like the test was also added as a new standalone file `pandas/core/frame_test_constructors.py`. This seems unintentional, duplicates the test already added in the correct test module, and places test code within the `pandas/core` directory. Or is it intentional?
I have updated the changes. Please check and let me know if any improvements are needed. Thank you 
@kpvenkat47 - as mentioned we should add a line to the whatsnew for v3.0 in `doc/source/whatsnew/` under the `I/O` section. Also the pre-commit and code checks are failing on this PR - those will need to be passing for this to be able to be merged. Let me know if you need any assistance here.
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.
BUG: Collision between equivalent frequencies 'QS-…
State: closed

…FEB' and 'QS-NOV'

- [x] closes #61086 (Replace 61086 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: Datetime
description: Datetime data dtype
name: Frequency
description: DateOffsets
name: Stale

Comments:
@rhshadrach pinging on green
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: Added docstring to Timestamp.tzinfo
State: closed

Follow up on #59458

Added docstring to `Timestamp.tzinfo`. Emphasized that `Timestamp.tz` is preferred due to its Pandas-specific functionality. Sections added are as follows:
- Summary
- Extended Summary
- See Also
- Examples

Removed `Timestamp.tzinfo` from code_checks.sh

- [ ] closes #59458 (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
- [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.
- [ ] 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:
Sorry, it appears a contributor already opened a PR a few days ago to address this issue in https://github.com/pandas-dev/pandas/pull/61100 that was merged.

Closing this PR as solved, but happy to have more PRs!
BUG: .mode(dropna=False) doesn't work with nullable integers
State: closed

Issue #58926
Edited `pandas.core.algorithms.mode` function so that mode(dropna=False) works with nullable integers.
PR of others before: https://github.com/pandas-dev/pandas/pull/58931

- [x] closes #58926 (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).
- [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: NA - MaskedArrays
description: Related to pd.NA and nullable extension arrays

Comments:
Thanks @halogen22
BUG: Fix inconsistency of converting empty categorical with dtype_backend='pyarrow'
State: closed

Follows up #59935

- [x] closes #59934 (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).
- [ ] 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: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Categorical
description: Categorical Data Type

Comments:
Thanks @yuanx749
fix for 61123 read_excel nrows param reads extra rows
State: closed

**Issue**: [GH-61123](#)  
When reading Excel files with `pd.read_excel` and specifying `nrows=4`, the behavior differs depending on whether there’s a blank row between tables. For a file with two tables (each with a header and 3 data rows), `nrows=4` should yield a DataFrame with one header and 3 data rows (shape `(3, n)`). However:
- In `test1.xlsx` (with a blank row), it correctly reads the first table (header + 3 rows).
- In `test2.xlsx` (no blank row), it incorrectly includes the second table’s header as a data row, resulting in a shape of `(4, n)`.

This inconsistency occurs because `read_excel` doesn’t properly respect table boundaries when tables are adjacent, despite the `nrows` limit.

**Fix**:  
- Modified `pandas/io/excel/_base.py` and related reader modules (`_openpyxl.py`, `_pyxlsb.py`, `_xlrd.py`) to ensure `nrows` limits reading to the specified number of rows, excluding subsequent table headers even when tables are adjacent.
- Added a new test `test_excel_read_tables_with_and_without_blank_row` in `pandas/tests/io/excel/test_readers.py` to verify that `nrows=4` consistently returns a DataFrame with shape `(3, 2)` (header + 3 data rows) for both cases.

**Changes**:
- Updated Excel reader logic to stop at `nrows` without parsing beyond table boundaries.
- Ensured consistent behavior across `openpyxl`, `pyxlsb`, and `xlrd` engines.
- Squashed commits into a single commit for clarity.

**Verification**:
- Tested with `test1.xlsx` (blank row) and `test2.xlsx` (no blank row).
- Confirmed both now yield a DataFrame with shape `(3, 2)` and only the first table’s data.

**Steps to Test**:
1. Run `pytest pandas/tests/io/excel/test_readers.py::TestReaders::test_excel_read_tables_with_and_without_blank_row`.
2. Verify `df1.shape == (3, 2)` and `df2.shape == (3, 2)` match the expected output.

**Related Files**:
- `pandas/io/excel/_base.py`
- `pandas/io/excel/_openpyxl.py`
- `pandas/io/excel/_pyxlsb.py`
- `pandas/io/excel/_xlrd.py`
- `pandas/tests/io/excel/test_readers.py`

Closes #61123

Labels:

Comments:
yeah, was running a test on behalf of Jolt AI to see how their system would handle these types of issues. am fine to close the PR.
WEB: Update sponsors and fix logos style
State: closed

Updating the list of sponsors, @jreback @jorisvandenbossche @jbrockmendel please let me know if I'm mistaken.

Also, fixing the style of the logos, which had the centering wrong, and a border was introduced by mistake:

![Screenshot at 2025-03-14 23-15-34](https://github.com/user-attachments/assets/fe67b218-b68d-4def-ae85-038dddc70a1e)


Labels:
name: Web
description: pandas website

Comments:
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/61121/
DOC: Added docstrings to min/max/reso for Timedelta
State: closed

Issue: #59698

Added docstrings to `pandas.Timedelta.min`,  `pandas.Timedelta.max`, and `pandas.Timedelta.resolution`

- [ ] closes #59698 (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
- [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.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Docs

Comments:
Thanks @j-hendricks
BUG/TST/DEPR: Ensure dtype="category" always implies ordered=False & add tests
State: closed

- [ ] closes #61074  
- [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.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Issue: Previously, if a Series had ordered=True, using astype("category") would incorrectly preserve the ordering. This was inconsistent and against expectations.

Fix:
1. Now, dtype="category" always implies ordered=False.
2. If ordered=True before conversion, a deprecation warning is raised to inform users.
3. Tests have been updated to verify this new behavior.


Labels:

Comments:
Going to close this PR pending discussion on the original issue. We can reopen once there is more consensus on moving forward here
BUG: Fix bug in reindexing of period columns after unstack
State: closed

- [ ] closes #60980
- [ ] closes #60273
- [ ] [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/v3.0.0.rst` file if fixing a bug or adding a new feature.

When indexing a `Period` block, the `BaseBlockManager.reindex_indexer` method thinks `Period` blocks can't store 2D values and always returns the first element. This is because it uses a hardcoded list of types (which is missing `PeriodDtype`) that are known to allow 2D values. The fix is to use the `is_1d_only_ea_dtype` utility function which internally uses the `_supports_2d` flag of the dtype.

The bug only happens when indexing a 2D period block, which may be created after operations like transpose, pivot, unstack etc.

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

Comments:
Thanks @snitish
TST: Add test for retaining dtype of datetime columns in DataFrame.to_hdf
State: closed

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

Comments:
Re-opening this PR from last year; In the past PR, there was CI errors but it currently looks good. All checks passed 
Thanks @KevsterAmp
DOC: Updated link for OVH server benchmark visualization
State: closed

- [x] closes #60915 (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
- [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.
- [ ] 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:
> Happy to - but I'm not sure what you mean by "the benchmarks page". Can you clarify?

The page being edited in this PR :)
Merging this to fix the wrong and broken links. Thanks @jackbtlr for the PR. Feel free to edit this document as needed in a follow up @rhshadrach
DOC: fix docstring validation errors for pandas.util.hash_pandas_object and pandas.Timestamp.resolution
State: closed

follow up on issue #59458 and #27977

for pandas.util.hash_pandas_object:
- Add parameter description to obj parameter
- Correct the Returns section
	- Change the type line to correctly callout 'Series' type
	- Update return description to describe the type contained in the Series
- Add See Also section
- Removed from code_checks.sh

for pandas.Timestamp.resolution
- Removed from code_checks.sh (I don't believe more work is needed because resolution is no longer a function, see #29910 

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.
BUG: DataFrame.explode doesn't work for pyarrow.large_list type
State: closed

- [ ] closes #61091 
- [ ] [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/v3.0.0.rst` file if fixing a bug or adding a new feature.


Labels:
name: Arrow
description: pyarrow functionality

Comments:
Thanks @snitish
DOC: iss-59698-pandas-Timedelta-to_numpy-PR01 
State: closed

Updated dtypes and copy


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.