Updating generic.py error message

This is my first attempt at a PR. I just made a little change to allow an error message. Would appreciate some feedback. 
Based on https://github.com/pydata/pandas/issues/8015
The nosetests fail but sure :)

On Thu, Oct 30, 2014 at 1:20 PM, Joris Van den Bossche <
notifications@github.com> wrote:

> In pandas/core/generic.py:
>
> > @@ -2868,9 +2868,17 @@ def groupby(self, by=None, axis=0, level=None, as_index=True, sort=True,
> >          """
> >
> >          from pandas.core.groupby import groupby
> > -        axis = self._get_axis_number(axis)
> > -        return groupby(self, by, axis=axis, level=level, as_index=as_index,
> > -                       sort=sort, group_keys=group_keys, squeeze=squeeze)
> > +        if axis is not None:
> > +            axis = self._get_axis_number(axis)
> > +            return groupby(self, by, axis=axis, level=level, as_index=as_index,
> > +                        sort=sort, group_keys=group_keys, squeeze=squeeze)
> > +        elif level is not None:
> > +            raise TypeError('You have to specify one of "by" or "level"')
> > +        elif by is not None:
> > +            raise TypeError('You have to specify one of "by" or "level"')
> > +        else:
> > +            raise TypeError('You have to specify one of "by" or "level"')
>
> Hmm, difficult to say without seeing the code. Can you just push your
> latest attempt?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pydata/pandas/pull/8618/files#r19600958>.
>



-- 
Peadar Coyle
Skype: springcoilarch
www.twitter.com/springcoil
peadarcoyle.wordpress.com