I want to convert the data which is recorded in 10Hz into 1Hz. I saw some solutions and i tried it, DO i need to use resample function?, do i need to convert timestamp into sec or minute something? My question is I have data in millions of rows when i convert that data 10Hz to 1Hz, data will get reduced or it will increase?
Would be great if you could help me, Thanks in advance.
start_timestamp | end_timestamp | interpreted_value | Frequency |
---|---|---|---|
2020-11-24 07:14:24.903187 | 2020-11-24 07:14:25.003187 | 5.96875 | 10Hz |
2020-11-24 07:14:25.003187 | 2020-11-24 07:14:25.103187 | 6.515625 | 10Hz |
2020-11-24 07:14:25.103187 | 2020-11-24 07:14:25.203187 | 7.109375 | 10Hz |
2020-11-24 07:14:25.203187 | 2020-11-24 07:14:25.303187 | 7.609375 | 10Hz |
2020-11-24 07:14:25.303187 | 2020-11-24 07:14:25.403187 | 8.21875 | 10Hz |
Below is the code i tried :
df1=df.resample('1S',on='start_timestamp').mean().dropna()
Or
df1=df.set_index('start_timestamp').resample('20L').mean().dropna()