BUG: df.copy
removes attributes from series in the original dataframe
#38107
Labels
df.copy
removes attributes from series in the original dataframe
#38107
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Problem description
Calling copy on a dataframe probably shouldn't modify it or it's contents (especially those exposed through public attributes) in any way.
I would also ague the copy should keep these attributes, but that's more related to #35425
Expected Output
The second
display(df["a"].attrs)
should print:{'key': 'value'}
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: