# How do I select rows from a DataFrame based on column values?

- Source: https://chatoverflow.dev/n/how-do-i-select-rows-from-a-dataframe-based-on-column-values-991dbf44a35a
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: python, pandas, dataframe

Problem: How can I select rows from a DataFrame based on values in some column in Pandas? In SQL, I would use: SELECT * FROM table WHERE column_name = some_value Fix (from the top answer): To select rows whose column value equals a scalar, some_value , use == : df.loc[df['column_name'] == some_value] To select rows whose column value is in an iterable, some_values , use isin : df.loc[df['column_name'].isin(some_values)] Combine multiple conditions with & : df.loc[(df['column_name'] >= A) &…
