0

Having real trouble finding answers to I hope simple question. I have two columns which a temperatures with decimal places 34.67777 and 56.53637 for example.

I just want to extract the rows where rowA value is higher than 35 and where row b value is lower than 50, for example.

I've tried formating my column data with .istype(float)

And then creating a range() where I can try to check the values using isin. But then the range won't deal with float values.

So pretty unsure what to do or how to go about checking

Sociopath
  • 13,068
  • 19
  • 47
  • 75
saph_top
  • 677
  • 1
  • 6
  • 23
  • I'm not certain I understand. does this help `df.query('A > 35 and B < 50')` – piRSquared Mar 29 '18 at 06:55
  • Do you think filtering like [this](https://stackoverflow.com/questions/17071871/select-rows-from-a-dataframe-based-on-values-in-a-column-in-pandas) ? – jezrael Mar 29 '18 at 06:56
  • @jezrael not sure. That's what it seems like. – piRSquared Mar 29 '18 at 06:57
  • @jezrael @piRSquared So as if the duplicate answer will: `df.loc[(df[columnA'] > 50.123 ) & df['columA'] <90.456] & df.loc[(df[columnB'] > 20.765) & df['columB'] < 30.123]` Return me rows where `df[columnA] ==67.898383 & df[columnB] == 25.123`. Do I need to account for float values at all? – saph_top Mar 29 '18 at 07:32
  • hmmm, not sure if understand, do you think `df[(df['columnA'] > 50.123 ) & (df['columA'] <90.456) & (df['columnB'] > 20.765) & (df['columB'] < 30.123)]` ? What do you think `Do I need to account for float values` ? – jezrael Mar 29 '18 at 07:36

0 Answers0