Time series graph analysis by detecting specific point increment and decrement

Viewed 59

I have one month hourly flow data as follows

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
df = pd.DataFrame(index=pd.date_range(start = "01/01/2010", end = "02/01/2010"),
              data=np.random.rand(32)*140,
              columns=['data'])

df.plot(label='data')
plt.legend(); plt.ylabel('flow')

The maximum and minimum flow values are 140 and 30. Data in x-axis is hourly distributed.

"My task is to distribute flow data in a way that when value decrease from 100 to 30 it should take 4.5 hours. If flow value is less than 100 (while going down) it should follow same slope as it did in previous condition."

In simple, I have to draw a line from point 100 to 30 with slope -15.55 while trend are decreasing. But don't know how to detect point 100 and its occurring time in x-axes.

Need some code and analyze advise to do it.

I am very new in python and trying to learn techniques. Would be appreciable if can suggest different way to do and some explanation if possible. Thank You.

0 Answers
Related