Description
Feature Type
-
Adding new functionality to pandas
-
Changing existing functionality in pandas
-
Removing existing functionality in pandas
Problem Description
I (don't ask how 😅) came over the fact that this:
pd.DataFrame({"a": [1, 2, 3]}).astype("hurdy-gurdy")
Raises a helpful 'TypeError: data type "hurdy-gurdy" not understood message'
But this doesn't happen if the incorrect type is "double," (I'm not sure why but I assume something around the fact that pandas needs to check for types such as "double[pyarrow]").
This code:
pd.DataFrame({"a": [1, 2, 3]}).astype("double,")
Raises the error: "TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''".
Feature Description
Throw the safe "double," is not a valid type error message
Alternative Solutions
Probably involves digging slightly into the part of the code that's throwing an error - I'd love to put in a PR if this is something that'd be accepted?
Additional Context
No response