I'm a beginner with Python. I have a csv file with a single column of numbers, I have to find all the numbers that are greater than the previous and the following. I don't understand how I can apply a for-loop to the file column.
The code I tried is the following:
import pandas as pd
pf = pd.read_csv(r'C:\Users\Fra\Desktop\IO.csv')
print(pf)
results = []
for column in pf:
for i in range(len(column)):
if(x[i]>x[i-1] and x[i]>x[i+1]):
results.append(x[i])
print(results)