import pandas as pd import numpy as np class SubclassedSeries(pd.Series): pass class SubclassedDataFrame(pd.DataFrame): _constructor_sliced = SubclassedSeries df = SubclassedDataFrame(np.random.random((3, 2)) i, row = next(df.iterrows()) assert isinstance(row, SubclassedSeries) # failsExpected Output
row
would be of proper overriden _constructor_sliced
type (i.e. SubclassedSeries
).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4