Because the time interval (86,400 seconds) equals one day, the function groups the first two rows together and the last two rows together, and calculates the volume-weighted average price for each group.
id | name | timestamp | vwap |
---|---|---|---|
1 | IBM | 1961-05-22 00:00:00 | 457.247 |
1 | IBM | 1961-05-26 00:00:00 | 465.132 |
1 | IBM | 1961-06-02 00:00:00 | 494.12 |
1 | IBM | 1961-06-09 00:00:00 | 494.896 |
1 | IBM | 1961-06-16 00:00:00 | 486 |
1 | IBM | 1961-06-21 00:00:00 | 478.605 |
2 | GE | 1961-05-22 00:00:00 | 67.8986 |
2 | GE | 1961-05-26 00:00:00 | 65.7631 |
2 | GE | 1961-06-02 00:00:00 | 65.8226 |
2 | GE | 1961-06-09 00:00:00 | 66.6285 |
2 | GE | 1961-06-16 00:00:00 | 66.4806 |
2 | GE | 1961-06-21 00:00:00 | 64.1541 |
3 | PG | 1961-05-22 00:00:00 | 18.0168 |
3 | PG | 1961-05-26 00:00:00 | 17.5237 |
3 | PG | 1961-06-02 00:00:00 | 19.2977 |
3 | PG | 1961-06-09 00:00:00 | 22.785 |
3 | PG | 1961-06-16 00:00:00 | 24.1296 |
3 | PG | 1961-06-21 00:00:00 | 24.4742 |
... | ... | ... | ... |