You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import pandas as pd
class TestDataFrame(pd.DataFrame):
_metadata = ['testattr']
@property
def _constructor(self):
return TestDataFrame
df = TestDataFrame({0: [1, 2, 3], 1: [1, 2, 3]})
df.testattr = 'XXX'
df.testattr
# XXX
# Using list is OK
df.iloc[[0, 1], :].testattr
# XXX
# Using slice is NG
df.iloc[0:1, :].testattr
# AttributeError: 'TestDataFrame' object has no attribute 'testattr'
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: