简体   繁体   中英

Mean/Std calculation of data-set logging change of value only

I wish to calculate the mean, and std of a time series data-set that only records when there is a change in value.

The time series is at 1 second intervals, which puts the risk of a bloated data-set if each missing value between changes is generated.

Example of data set type: [Epoch, Value]

[[152345235, 3], [152345335, 12], [152345835, 8]]

We are using python for cleaning and aggregating the data. A sparse matrix would not suffice, as it is based on ignoring 0 values, which are not present. On research there was nothing showing that could readily solve this problem.

My question is, has anyone come across a similar problem, and if so what techniques were used to solve.

I would order the list by epoch , then multiply the value of each by the difference between epochs . You don't need to store extra data that way, but you can pretty easily solve for the mean.

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