https://pandas.pydata.org/pandas-docs/version/1.0.2/getting_started/intro_tutorials/03_subset_data.html

https://pandas.pydata.org/pandas-docs/version/1.0.2/getting_started/intro_tutorials/03_subset_data.html

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: https://stackoverflow.com/questions/68473789/https-pandas-pydata-org-pandas-docs-version-1-0-2-getting-started-intro-tutori

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: