I need some help understanding the logic / syntax:

Why do I have to call titanic a second time inside the [] brackets? To get the passengers from cabin class 2 and 3.

class_23 = titanic[titanic["Pclass"].isin([2, 3])]

Read more here:

Content Attribution

This content was originally published by JaDDeL at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: