Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Changing values in a column
- titanic.loc[1:3, "age"] = 42
- titanic.loc[1:4, 3] = [43, 44, 45]
- titanic.loc[titanic.age < 1, "age"] = 1
- # Changing values in a row
- titanic.loc[0, "survived" : "sex"] = [1, 1, "female"]
- ######################################
- titanic.replace(0, "Zero")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement