I have brought the data from excecl(csv) and it is about 300000 rows * 1 column and I plotted by db.plot() ----- it is a time series data
I am trying to delete (drop) the data that is higher than 0.006 and, after that
I want to compare the difference between the data(step by step : the one next to each other) and if the difference is bigger 0.00001, I want to drop thos data also.
then, I will be only left with data with very very low difference (almost 0, flat slope).
I am a very beginner in python and I tried my best but I don't know what is wrong with my code:
import pandas as pd
excel_df = pd.read_csv('data.csv', header=None)
excel_df.plot()
bool_idx = excel_df < 0.006
valid_data = excel_df[bool_idx]
true_data = valid_data.dropna()
# print(true_data)
# print(valid_data)
ax1 = valid_data.plot()
ax1.set_ylim(-0.005, 0.045)
ax1.plot()
print(true_data)
al2 = true_data.diff()
# print(al2)
number = 0
for true_data in ture data:
number = number + 1
if true_data.diff() < 0.00001:
true_data.drop()
print(true_data)