ENH: retain attrs when concat dataframes · Issue #41828 · pandas-dev/pandas (original) (raw)
Is your feature request related to a problem?
I wish the attrs could be retained when concat data frames.
d = {'col1': [1, 2], 'col2': [3, 4]}
df1 = pd.DataFrame(data=d)
df1.attrs = {1:1}
df2 = pd.DataFrame(data=d)
df2.attrs = {1:1}
pd.concat([df1, df2]).attrs
{}
Describe the solution you'd like
d = {'col1': [1, 2], 'col2': [3, 4]}
df1 = pd.DataFrame(data=d)
df1.attrs = {1:1}
df2 = pd.DataFrame(data=d)
df2.attrs = {1:1}
pd.concat([df1, df2]).attrs
{1: 1}
API breaking implications
N/A
Describe alternatives you've considered
N/A