I currently facing the issue that "functools.reduce(operator.iadd,...)" alters the original input. E.g.
I have a simple dataframe df = pd.DataFrame([[['A', 'B']], [['C', 'D']]])
0
0 [A, B]
1 [C, D]
Applying the iadd operator leads to following result:
functools.reduce(operator.iadd, df[0])
['A', 'B', 'C', 'D']
Now, the original df changed to
0
0 [A, B, C, D]
1 [C, D]
Also copying the df using df.copy(deep=True) beforehand does not help.
Has anyone an idea to overcome this issue? THX, Lazloo