You have to define the range of values in that paticular column. df_out = df_in.loc[(df_in[col_name] > fence_low) & (df_in[col_name] < fence_high)] There is no direct code for it.