Pandas GroupBy Doesn't Persist After Applying Quantiles?
<p>I'm trying to get quantiles for two distinct groups in a Pandas df. I'm able to apply to quantiles function and get a table with grouped results, however, I can't seem to call the groupby attributes on the dataframe after doing so. Example:</p>

<pre><code>rand = np.random.RandomState(1)
df = pd.DataFrame({'A': ['foo', 'bar'] * 3,
                   'B': rand.randn(6),
                   'C': rand.randint(0, 20, 6)})
gb = df.groupby(['A'])
gb.groups
</code></pre>

<p>This returns something like:</p>

<pre><code>{'bar': [1, 3, 5], 'foo': [0, 2, 4]}
</code></pre>

<p>Then I apply the quantile function:</p>

<pre><code>q=gb.quantile(np.arange(0,1.1,.1))
</code></pre>

<p>When I print this df, it shows the two groups, but when I try to call them, it throws an error:</p>

<pre><code>q.group
AttributeError: 'DataFrame' object has no attribute 'group'
</code></pre>

<p>How can I call the groups in the quantile dataframe?</p>

<p>You can call specific groups using the index:</p>

<pre><code>q.loc['foo']
</code></pre>

python pandas