I have a text file which contain two rows. I want to find local maximums of first row. I am trying below code, but I do not know why I get this error: "x
must be a 1D array"
f= open ('ttt.txt', 'r')
data = f.readlines()
for line in data:
c=line.split(' ')[0]
d=float (c)
a= np.array (d)
peaks, _ = find_peaks(a, height=0)
The input is like this:
0 5
1 5
2 5
3 6
1 6
0 7
0 6
0.01 5
0.4 5
0.001 5
0.3 6
0.7 6
1.5 7
4 6
2 5
0.1 6
0 6
The output should be:
3 6
0.4 5
4 6