Clean values¶
-
Clean.
strip
(col: str)¶ Remove leading and trailing white spaces in a column’s values
Parameters: col (str) – name of the column Example: ds.strip("mycol")
-
Clean.
strip_cols
()¶ Remove leading and trailing white spaces in columns names
Example: ds.strip_cols()
-
Clean.
roundvals
(col: str, precision: int = 2)¶ Round floats in a column. Numbers are going to be converted to floats if they are not already
Parameters: - col (str) – column name
- precision – float precision, defaults to 2
- precision – int, optional
Example: ds.roundvals("mycol")
-
Clean.
replace
(col: str, searchval: str, replaceval: str)¶ Replace a value in a column in the main dataframe
Parameters: - col (str) – column name
- searchval (str) – value to replace
- replaceval (str) – new value
Example: ds.replace("mycol", "value", "new_value")