title: ValueError: Grouper for 'xxxx' not 1-dimensional
body: <p>For the following code input</p>
  
  <pre><code>cyclestrain = train.groupby('Unit', as_index=True)['cycles'].max()
  cyclestest = test.groupby('Unit', as_index=True)['cycles'].max()
  </code></pre>
  
  <p>I am getting this error:</p>
  
  <blockquote>
    <p>File
    "D:/FH-Sudwestfalen/CMAPSS_Aircraft_Data/predict-remaining-useful-life-master/neuralnetwork.py", line 57, in 
        cyclestrain = train.groupby('Unit', as_index=True)['cycles'].max()</p>
    
    <p>File
    "C:\Users\nvidh\Anaconda3\lib\site-packages\pandas\core\generic.py",
    line 6665, in groupby
        observed=observed, **kwargs)</p>
    
    <p>File
    "C:\Users\nvidh\Anaconda3\lib\site-packages\pandas\core\groupby\groupby.py",
    line 2152, in groupby
        return klass(obj, by, **kwds) File "C:\Users\nvidh\Anaconda3\lib\site-packages\pandas\core\groupby\groupby.py",
    line 599, in <strong>init</strong>
        mutated=self.mutated)</p>
    
    <p>File
    "C:\Users\nvidh\Anaconda3\lib\site-packages\pandas\core\groupby\groupby.py",
    line 3315, in _get_grouper
        if not isinstance(gpr, Grouping) else gpr</p>
    
    <p>File
    "C:\Users\nvidh\Anaconda3\lib\site-packages\pandas\core\groupby\groupby.py",
    line 3025, in <strong>init</strong>
        raise ValueError("Grouper for '%s' not 1-dimensional" % t)</p>
    
    <p>ValueError: Grouper for 'Unit' not 1-dimensional</p>
  </blockquote>