Hi @xiki-tempula, thanks for the report.
This is indeed currently not implemented(xref #28283), and I guess the correct way to propogate metadata in this case would be to drop them when they don't match as in your example. PRs to fix this are welcome.
cc @TomAugspurger
I'm thinking that the logic of the concat should be
def concat(objs, *args, **kwargs):
'''Concatenate pandas objects along a particular axis with optional set
logic along the other axes. If all pandas objects has the same attrs
attribute, the new pandas objects would have this attrs attribute. A
ValueError would be raised if any pandas object has a different attrs.
Returns
-------
DataFrame
Concatenated pandas object.
'''
# Sanity check
attrs = objs[0].attrs
for obj in objs:
if attrs != obj.attrs:
raise ValueError('All pandas objects should have the same attrs.')
new = pd.concat(objs, *args, **kwargs)
new.attrs = attrs
return new
Is your feature request related to a problem?
I wish the attrs could be retained when concat data frames.
Describe the solution you'd like
API breaking implications
N/A
Describe alternatives you've considered
N/A
The text was updated successfully, but these errors were encountered: