How to average the data from 6 or less rows in a dataframe into one row?

Viewed 30

I want to do a correlation analysis between 2 dataframes in python using pandas.

The data in one df is recorded in 3 minute sections and the data in the other is recorded in 30 second sections. However to do this I first need to clean the data which results in some three minute values consisting of less than 6 values or not existing at all. And than create an average value to compare it with the other df.

How can I average the 30 seconds of data into three minutes and compare it to the other df?

          Day      Time Senderrate     S-Unit Retransmissions Receiverrate     R-Unit
0  18.08.2019  11:42:05       1087  Mbits/sec               0         1087  Mbits/sec
1  18.08.2019  11:45:06       1141  Mbits/sec               0         1141  Mbits/sec
2  18.08.2019  11:48:06       1049  Mbits/sec               0         1049  Mbits/sec
...

And the other:

                     Time  Alarm Sichtweite  Error Code  Sichtweite (m) 1min average  ...  Rain (mm) cumulated Snow (mm) cummulated  Temp (C°)  Luminance (cd/m²)
0     2019-06-12 00:00:20                 0           0                        20000  ...                 0.29                    0       23.6                  4
1     2019-06-12 00:01:20                 0           0                        20000  ...                 0.29                    0       23.6                  4
3     2019-06-12 00:01:50                 0           0                        20000  ...                 0.29                    0       23.6                  4
...

So far I came across no solution, so any help would be greatly appreciated

0 Answers
Related