-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BugCompatpandas objects compatability with Numpy or Python functionspandas objects compatability with Numpy or Python functionsIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves
Milestone
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.
Metadata
Metadata
Assignees
Labels
BugCompatpandas objects compatability with Numpy or Python functionspandas objects compatability with Numpy or Python functionsIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves