pandas.Series.replace — pandas 0.24.2 documentation | Series replace
Parameters:to_replace:str,regex,list,dict,Series,int,float,orNoneHowtofindthevaluesthatwillbereplaced.Seetheexamplessectionforexamplesofeachofthese.value:scalar,dict,list,str,regex,defaultNoneValuetoreplaceanyvaluesmatchingto_replacewith.ForaDataFrameadictofvaluescanbeusedtospecifywhichvaluetouseforeachcolumn(columnsnotinthedictwillnotbefilled).Regularexpressions,stringsandlistsordictsofsuchobjectsarealsoallowed.inplace:bool,defaultFalseIfTrue,inplace.Note:thiswillmodifyanyotherviewsonthisob...
Parameters:to_replace : str, regex, list, dict, Series, int, float, or NoneHow to find the values that will be replaced.
See the examples section for examples of each of these.
value : scalar, dict, list, str, regex, default NoneValue to replace any values matching to_replace with. For a DataFrame a dict of values can be used to specify which value to use for each column (columns not in the dict will not be filled). Regular expressions, strings and lists or dicts of such objects are also allowed.
inplace : bool, default FalseIf True, in place. Note: this will modify any other views on this object (e.g. a column from a DataFrame). Returns the caller if this is True.
limit : int, default NoneMaximum size gap to forward or backward fill.
regex : bool or same types as to_replace, default FalseWhether to interpret to_replace and/or value as re...