Get all keys from GroupBy object in Pandas : <p>I'm looking for a way to get a list of all the keys in a GroupBy object, but I can't seem to find one via the docs nor through Google. </p>

<p>There is definitely a way to access the groups through their keys, like so:</p>

<pre><code>df_gb = df.groupby(['EmployeeNumber'])
df_gb.get_group(key)
</code></pre>

<p>...so I figure there's a way to access a list (or the like) of the keys in a GroupBy object. I'm looking for something like this:</p>

<pre><code>df_gb.keys
Out: [1234, 2356, 6894, 9492]
</code></pre>

<p>I figure I could just loop through the GroupBy object and get the keys that way, but I think there's got to be a better way.</p>
