Detect data within csv column with python

Question:

I have this following csv and it looks like this:

enter image description here

I want to detect if there is any cells that are more than 1.25 in values.

I have tried using this code but it seems wrong. Any ideas? (I use loop because it’s more than 1 csv)

dflist = []
for i, file in enumerate(flist):
    df = pd.read_csv(file, skiprows = [0,1,3,4])
    dflist.append(df)
    if df.iloc[:,45:52].values.flatten()[i] >= 1.2:
        print([i],'Hard Landing')
    else:
        print([i],'Normal Flight')
Asked By: ojasony

||

Answers:

You can simply use df.values function of pandas. It returns a numpyarray.

    x = df.values
    w = list(map(float,x))
    y = w[w>1.25]
    if y.size != 0:
      print("Greater Value Exist") 
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.