pydata/pandas — pull request #4271 by cfarmer (2013-07-16 22:33:59+00:00)
Title: Easier sub-classing for Series and DataFrame

This is a relatively trival 'fix', which makes it easier to sub-class Pandas Series' and Dataframes. Basically, it makes more consistent use of `self._constructor` when constructing outputs from operations on Series' and DataFrames. For example, with these changes, this is now possible:

In [1]: from pandas import Series
In [2]: class MySeries(Series):
def say_hello(self):
print "hello!"
In [3]: s = MySeries([1,2,3,4,5])
In [4]: s.say_hello()
hello!
In [5]: s.__class__
Out[5]: __main__.MySeries
In [6]: s2 = s[1:3]
In [7]: s2.__class__
Out[7]: __main__.MySeries
In [8]: s2.say_hello()
hello!

This addresses (to some extent) issues #1713 and #60 and the issues mentioned therein. After these changes, all nosetests continue to pass (except those that skip).

Note: This is my first 'pull request', so be gentle!