Closed
Description
Running the code:
import pandas
class SubclassedSeries(pandas.Series):
@property
def _constructor(self):
return SubclassedSeries
@property
def _constructor_expanddim(self):
return SubclassedDataFrame
def c(self):
return 1
class SubclassedDataFrame(pandas.DataFrame):
@property
def _constructor(self):
return SubclassedDataFrame
@property
def _constructor_sliced(self):
return SubclassedSeries
b = SubclassedDataFrame([[1,2,3,4],[2,3,4,5]])
print(b[0].c())
works as expected.
However running:
print(b.ix[1].c())
throws an exception as:
b.ix[1]
returns a Series instance instead of an SublcassedSeries instance as expected.