简体   繁体   中英

Add next estimated value to row in pandas dataframe

I have a pandas dataframe and trying to calculate an (estimated) value for the next cell in each row.

For example, I have the values: 2.1, 5.3, 8.5, 13.7 and want to estimate the next value in the sequence.

The sequence has no pattern and could be increasing or decreasing but will never be a negative number, so it could be: 10,9,8,7,6 etc. (but never -1).

Its possible that the sequence will have values greater and less than the previous number, like: 2, 4, 8, 5, 2, 6.

I have not linked any code examples because I'm in a right mess! If anyone can point me in the right direction I would be most grateful.

Thank you

It would be helpful if you could provide an example DataFrame, but it seems to me like what you're looking for is an autoregressive model.

A decent example is here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM