I have the following data frame called data_frame:
a b c
0 [1, 2] [3, 4] [5, 6]
1 [7, 8] [9, 10] [11, 12]
2 [13, 14] [15, 16] [17, 18]
What I want to do is element-wise mean of list in all rows. For instance, the result data should be:
a b c
0 [(1 + 7 + 13) / 3, (2 + 8 + 14) / 3] [(3 + 9 + 15) / 3, (4 + 10 + 16) / 3] [(5 + 11 + 17) / 3, (6 + 12 + 18) / 3]
If each element in pandas was a single value, this could be done by data_frame.mean().
However, how can it be done if each element in pandas is the list shown above?