Snippet 1
df['col1'] = np.where(df['col1'] == 0, df['col2'], df['col1'])
df['col1'] = np.where(df['col1'] == 0, df['col3'], df['col1'])
Snippet 2
data['result'] = data['result'].map(lambda x: x.lstrip('+-').rstrip('aAbBcC'))
Copyright © Code Fetcher 2020