import pandas as pd
df = pd.DataFrame({'First Name':['Mary', 'John', 'Jennifer', 'Joel'],
'Last Name':['Jones', 'Smith', 'Williams', 'Miller'],
'Salary':[10000, 20000, 30000, 40000]})
print(df)
#create a new column using using the salary column. Increase the salary by 10%
df['New_Salary'] = df.apply(lambda row: row.Salary + (row.Salary * 0.1), axis = 1)
print(df)
output
Comments
Leave a comment