I want to change the value of a Cabin column in my data frame.
Here's my dataframe:
I would like to assign the value to be 1, where the Cabin is not equal to 0. That means the value of C85, C123, E46 should be 1 and rest of the values should be same.
This is the code, but I am getting a value error.
if df_train.Cabin != 0:
df_train.Cabin = 1
else:
df_train.Cabin = 0
