Skip to content

Conversation

khemkaran10
Copy link
Contributor

@khemkaran10 khemkaran10 commented Jul 16, 2025

Before Fix:

>>> df = pd.DataFrame({"a": [1, 2, 3]})
>>> df.describe(include=["datetime"])
...
ValueError: No objects to concatenate

After Fix:

>>> df = pd.DataFrame({"a": [1, 2, 3]})
>>> df.describe(include=["datetime"])
...
ValueError: No columns match the specified include or exclude data types

@khemkaran10
Copy link
Contributor Author

pre-commit.ci autofix

@mroeschke mroeschke added the Error Reporting Incorrect or improved errors from pandas label Jul 16, 2025
@khemkaran10
Copy link
Contributor Author

df = pd.DataFrame({"a": [1, 2, 3]})
df.describe(exclude=[np.int64])
...
ValueError: None of the included dtypes are present in the DataFrame

After the fix, this example will also show the same error. Should we change the error message to something like,
No columns match the specified include or exclude data types

@khemkaran10 khemkaran10 requested a review from mroeschke July 16, 2025 18:19
@khemkaran10
Copy link
Contributor Author

@mroeschke I have made the requested changes. can you please review it.

Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Aug 26, 2025
@mroeschke mroeschke removed the Stale label Oct 5, 2025
@mroeschke mroeschke added this to the 3.0 milestone Oct 5, 2025
@mroeschke mroeschke merged commit ff8ac64 into pandas-dev:main Oct 5, 2025
42 checks passed
@mroeschke
Copy link
Member

Thanks @khemkaran10

jzwick pushed a commit to jzwick/pandas that referenced this pull request Oct 8, 2025
…ror with clear error message. (pandas-dev#61871)

Co-authored-by: Khemkaran <[email protected]>
Co-authored-by: Matthew Roeschke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: describe(include=..) fails with unrelated error if provided data types are not present
2 participants