I’d like to have a function df_out(df_in,val_min,val_max) that makes a sorted series/dataframe from another series/dataframe by picking rows where values in one column are within a defined range. E.g., if df_in looks like this:
Name Age
John 13
Jack 19
Sylvia 21
Anna 14
Carlos 15
Vladimir 30
Gustav 28
Amie 24
I’d like df_out(18,25) to look like this:
Name Age
Jack 19
Sylvia 21
Amie 24
What's the most "pythonic" way to do this? Thanks!