-3

My dataFrame looks like this.

enter image description here

i only want the values for ford and honda and amc. Is there any way i can get these values.

I tried this but its not working. x= grouped["ford", "buick" , "honda"].agg([np.min, np.max, np.mean])

Ilya Yaremchuk
  • 2,007
  • 2
  • 19
  • 36
Atiq Patel
  • 33
  • 7
  • https://stackoverflow.com/questions/17071871/select-rows-from-a-dataframe-based-on-values-in-a-column-in-pandas – ddg Feb 08 '18 at 01:41

1 Answers1

0

You need something like this.

brand=["ford", "buick" , "honda"]

df_new=df[df['brands'].isin(brand)]
Sociopath
  • 13,068
  • 19
  • 47
  • 75