I am trying to do a data analysis, where I import data as numpy array of floats, where some values are below 0. Then I select a column named load
and I want to find an indices where the values are >0.1
However I am getting an error: "only integers, slices (\`:\`), ellipsis (\`...\`), numpy.newaxis (\`None\`) and integer or boolean arrays are valid indices"
what am I doing wrong please?
import numpy as np
import pandas as pd
data=pd.read_csv('C1.txt',delim_whitespace=True ,
skiprows=10, skip_blank_lines=True )
data_array=data.to_numpy()
load=data_array[10:,1]
res=list()
for idx in load:
if load[idx] > 0.1:
res.append(idx)
i need to find indices in array where values are over 0.1
the start of the data array looks like this:
0.063 -0.00174 0.063 -0.00075
0.094 0.00628 0.094 -0.00089
0.125 0.01292 0.125 -0.00111
0.156 -0.00027 0.156 0.00015
0.188 -0.00319 0.188 0.00108
0.219 -0.00733 0.219 -0.0007
0.25 -0.02446 0.25 -0.00074
0.281 -0.01493 0.281 -0.00078
0.313 0.01339 0.313 0.00019