featurebyte.Target.astype¶
astype(
new_type: Union[Type[int], Type[float], Type[str], Literal["int", "float", "str"]]
) -> FrozenSeriesTDescription¶
Convert a Series to have a new type. This is useful for converting a series between a string, and numerical types, or vice-versa.
Parameters¶
- new_type: Union[Type[int], Type[float], Type[str], Literal["int", "float", "str"]]
Desired type after conversion. Type can be provided directly, or as a string.
Returns¶
- FrozenSeriesT
A new Series with converted variable type.
Raises¶
- TypeError
If the Series dtype does not support type conversion.