python replace 0 in series

Solutions on MaxInterview for python replace 0 in series by the best coders in the world

showing results for - "python replace 0 in series"
Amy
12 Feb 2016
1#Series.replace(to_replace=None, value=None, inplace=False, limit=None, regex=False, method='pad')
2df['YourColumn'] = df['YourColumn'].replace(0,1) # Replace 0 with 1