Answers for "pandas new column with loc"

0

pandas new column with loc

df.loc[(df['c1'] == 'Value'), 'c2'] = 10
df.loc[~(df['c1'] == 'Value'), 'c2'] = df['c3']
Posted by: Guest on February-02-2022

Python Answers by Framework

Browse Popular Code Answers by Language