pandas slice on the other column value apply code example Example: pandas slice based on column value df.loc[df['column_name'] == some_value]