replace values of one column with values from another column from the same dataframe in pandas code example
Example 1: replace value of dataframe with another column
df['col1'] = np.where(df['col1'] == 0, df['col2'], df['col1'])
df['col1'] = np.where(df['col1'] == 0, df['col3'], df['col1'])
Example 2: replace 3 column with another column pandas
df['B'] = df1['E']