I stumbled upon the issue, that deepcopy does not actually copy the whole object with "on-the-fly" added attributes. Why is that and is there any solution to it?
Example:
import pandas as pd
from copy import deepcopy
frame_one = pd.DataFrame({'hello': [1,2,3], 'world': [4,5,6]})
frame_one.name = 'foo'
frame_two = deepcopy(frame_one)
frame_two.name
Error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "a_path\pandas\core\generic.py", line 5478, in __getattr__
return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'name'