Select rows from a DataFrame based on values in a column in pandas?
How to select rows from a DataFrame based on values in some column in pandas? In SQL I would use: select * from table where colume_name = some_value. *I tried to look at pandas documentation but did not immediately find the answer.*
Use an DataFrame within an DataFrame structure. df['A']>1 returns a 1-d boolean vector, indexing df with that vector will return only the rows where the boolean vector's value is True. Pandas documentation can be confusing. I recommend using this link to find detailed explanation for various types of indexing. https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html
Ethan J.
04/30/19