简体   繁体   中英

Resampling a frequency column in Pandas

I've been looking at the panda resample function, and it seems to only work for daily and above range. But, I want to resample a 64 Hz data into 8 Hz. The file is 170 MB, so I can't attach it here, but the data has 2 arrays, one for time, and the other for the corresponding value. Is it possible to resample it using by averaging it? any help would be appreciated.

Frequency is the inverse of time period . Essentially, you want to

  1. convert frequency to time period

     df['T'] = 1 / df['f'] 
  2. resample every 0.125s (or 1/8 ). Look at the df.resample docs for help.

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