0

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')
1
  • kindly share data, not pics. use this as a guide Commented Mar 28, 2020 at 11:02

1 Answer 1

0

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") 
Sign up to request clarification or add additional context in comments.

2 Comments

i got an error, TypeError: '>' not supported between instances of 'str' and 'float'
Convert the list to float. I have updated the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.