Try this
import pandas as pd df1 = pd.DataFrame([[10, 20, 30], [10, 20, 30], [10, 20, 30]]) df2 = pd.DataFrame([[11, 12, 13], [11, 12, 13], [11, 12, 13]]) df1.applymap(lambda x: [x]) + df2.applymap(lambda x: [x])
→
0 1 2 0 [10, 11] [20, 12] [30, 13] 1 [10, 11] [20, 12] [30, 13] 2 [10, 11] [20, 12] [30, 13]
Explanation: lambda x: [x] is a function which converts every argument x in a list of length 1 containing exactly that argument.
.applymap applies this function to every cell in the data frame.
+ (the sum operator) is "overloaded" for pandas data frames. In particular, the sum f1 + f2 of two frames (of equal shape) is defined as a new frame containing in each cell the sum of the corresponding cells of the operands (f1 and f2).
This is trivial if the cells contains numbers. But this also works for other data types: In Python lists can be concatenated via the sum operator: [1, 2] + [50, 60] → [1, 2, 50, 60].