Status
Done
All operations follow this fundamental pattern:
df['series'].operation(condition, [other_parameters])Where:
df['series'] selects the column/Series.operation() applies the conditional logiccondition is typically a boolean Series (True/False values)- Optional parameters modify default behavior
import pandas as pd
import seaborn as sns
# Load Titanic dataset
df = sns.load_dataset('titanic')survived pclass sex age sibsp parch fare embarked class who adult_male deck embark_town alive alone
0 0 3 male 22.0 1 0 7.2500 S Third man True NaN Southampton no False
1 1 1 female 38.0 1 0 71.2833 C First woman False C Cherbourg yes False
2 1 3 female 26.0 0 0 7.9250 S Third woman False NaN Southampton yes True
3 1 1 female 35.0 1 0 53.1000 S First woman False C Southampton yes False
4 0 3 male 35.0 0 0 8.0500 S Third man True NaN Southampton no True‣
1. Conditional Replacement Methods
‣
2. Membership Testing
‣
3. Boolean Evaluation
‣
Key Notes Table
‣