-1

Suppose I have the DF below and I want to select only the rows that have an Adj Close value over 90. I want to select all the columns for those values. How do I do that?

    High    Low Open    Close   Volume  Adj Close
Date                        
2020-01-02  86.139999   84.342003   84.900002   86.052002   47660500.0  86.052002
2020-01-03  90.800003   87.384003   88.099998   88.601997   88892500.0  88.601997
2020-01-06  90.311996   88.000000   88.094002   90.307999   50665000.0  90.307999
2020-01-07  94.325996   90.671997   92.279999   93.811996   89410500.0  93.811996
2020-01-08  99.697998   93.646004   94.739998   98.428001   155721500.0 98.428001

I am trying something like the following:

for i in data['Adj Close']:
    if i>200:
        print (data)

Thanks!

user7351541
  • 3
  • 1
  • 4

1 Answers1

0

As per what you said, the following code meets the solution

#import libs
import pandas as pd
import numpy as np

#import dataset
df = pd.read_csv('/content/Data.csv')

#filter
df[df['Adj Close']>90]

Obs: In google colab you have to add the database through the field that has a folder symbol and then click on the field (upload to session storage)

Test in my Google Colab

Data.csv Download