Example with current main:
>>> df = pd.DataFrame({"a": [1, 2, 3]})
>>> df.describe(include=["datetime"])
...
ValueError: No objects to concatenate
I assume the error comes from under the hood trying to concatenate the results of calculating the describe results for each of the incluced dtype groups, and in this case for datetime there is no content, so nothing to concatenate.
But we shouldn't propagate that error message to the user, I think. Either we should provide a better error message about none of the included dtypes being present, or just return an empty DataFrame.
Comment From: khemkaran10
@jorisvandenbossche we can wrap concat call in a try-except block and raise a clear error for this case. or we can add a check for "ldesc" . I'm happy to open a PR for this.
Comment From: jorisvandenbossche
Sounds good! Can probably add a check for ldesc
being an empty list before passing it to concat
Comment From: khemkaran10
take