I have data collected from sensors that looks like:
sec nanosec value
1001 1 0.2
1001 2 0.2
1001 3 0.2
1002 1 0.1
1002 2 0.2
1002 3 0.1
1003 1 0.2
1003 2 0.2
1003 3 0.1
1004 1 0.2
1004 2 0.2
1004 3 0.2
1004 4 0.1
I want to calculate average,std deviation
and some other stats like maximum, minimum for a column every 2 seconds.
so average for (1001, 1002)= 0.167, average of (1003,1004)=0.17
From the tutorials http://earthpy.org/pandas-basics.html, I think I should convert it to time series and the use rolling _means from pandas, but I am new to time series data so I am not sure if that is the correct way. Also how do I specify frequency here for conversion as observations for the first second have less observations. So for actual data I have less than 100 readings for 1001 second and then 100 observations for 1002 second onwards.
I could also do a simple groupby on seconds but it would group readings per second and not every 2 seconds, then how could i combine observations for 2 consecutive groups from groupby and then do analysis.