pandas icon indicating copy to clipboard operation
pandas copied to clipboard

DOC: convert_dtypes incorrectly assumes the output is a always DataFrame

Open Aloqeely opened this issue 1 year ago • 0 comments

Pandas version checks

  • [X] I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.Series.convert_dtypes.html

Documentation problem

The dtype_backend parameter says: "Back-end data type applied to the resultant DataFrame" but Series.convert_dtypes returns a Series not a DataFrame

On a sidenote, there are a few more methods in NDFrame that assume the method will be used on a DataFrame only

Suggested fix for documentation

"resultant DataFrame or Series" It would be even better to get rid of the unnecessary "DataFrame or Series" and have some way to know whether this doc is displayed for DataFrame.convert_dtypes or Series.convert_dtypes

Aloqeely avatar May 03 '24 04:05 Aloqeely