Is there a way to parallel loop two lists of columns in pandas df? For example, I need to create C1=A1 + B2, C2=A2+B2, C3=A3+B3...
df = pd.DataFrame(np.random.randn(3, 6),
columns=['A1', 'A2', 'A3','B1', 'B2','B3'])
A1 A2 A3 B1 B2 B3
0 -0.045858 0.627827 -1.562130 2.094783 0.654119 -0.996711
1 1.003585 0.735500 0.795338 -0.803864 -0.071655 -0.514118
2 0.083501 0.774820 -1.477767 -1.260052 0.861952 -0.674270
C1=df['A1']+df['B2'],C2=df['A2']+df['B2'],etc? i imagine the overhead of making threads/processes to act in parallel exceeds any benefit they provide for something like this ... how big is your df in reality?df['A1'] + df['B1']