DataFrame.replace()
pandas.DataFrame.replace
-
DataFrame.replace(to_replace=None, value=None, inplace=False, limit=None, regex=False, method='pad', axis=None)
-
Replace values given in ‘to_replace’ with ‘value’.
Parameters: to_replace : str, regex, list, dict, Series, numeric, or None
-
str or regex:
- str: string exactly matching
to_replace
will be replaced withvalue
- regex: regexs matching
to_replace
will be replaced withvalue
- str: string exactly matching
-
list of str, regex, or numeric:
- First, if
- First, if
-