Используемый набор данных «Титаник» имеет следующие два столбца: «embarked» и «embark_town». Я не понимаю следующую строку кода:
Код: Выделить всё
#to check if the missing values for embark and embarked column are for the same person,
# otherwise both columns could be filled based on the other column's value
df['embarked'][(df['embarked'].isnull()) & (df['embark_town'].isnull())]
#output
61 NaN
829 NaN
Name: embarked, dtype: object
Подробнее здесь: https://stackoverflow.com/questions/789 ... ta-columns