1# Changes the 'is_electric' column based on value in the 'type' column
2# If the 'type' column == 'electric' then the 'is_electric' becomes 'YES'
3df['is_electric']= df['type'].apply(lambda x: 'YES' if (x == 'electric') else 'NO')
1import pandas
2df = pandas.read_csv("test.csv")
3df.loc[df.ID == 103, 'FirstName'] = "Matt"
4df.loc[df.ID == 103, 'LastName'] = "Jones"