Convert types¶
-
Clean.
to_int
(*cols, **kwargs)¶ Convert some column values to integers
Parameters: - *cols (str, at least one) – names of the colums
- **kwargs (optional) – keyword arguments for
pd.to_numeric
Example: ds.to_int("mycol1", "mycol2", errors="coerce")
-
Clean.
to_float
(col: str, **kwargs)¶ Convert colums values to float
Parameters: - col (str, at least one) – name of the colum
- **kwargs (optional) – keyword arguments for
df.astype
Example: ds.to_float("mycol1")
-
Clean.
to_type
(dtype: type, *cols, **kwargs)¶ Convert colums values to a given type in the main dataframe
Parameters: - dtype (type) – a type to convert to: ex:
str
- *cols (str, at least one) – names of the colums
- **kwargs (optional) – keyword arguments for
df.astype
Example: ds.to_type(str, "mycol")
- dtype (type) – a type to convert to: ex: