does groupby concatenate the columns?
<p>i have a "1000 rows * 4 columns" DataFrame:</p>

<pre><code>a       b    c   d
1       aa   93  4
2       bb   32  3
...
1000    nn   78  2
**[1283 rows x 4 columns]**
</code></pre>

<p>and I use groupby to group them based on 3 of the columns:</p>

<pre><code>df.groupby(['a','b','c']).sum()

print(df)
a       b    c   d
1       aa   93  12
2       bb   32  53
...
1000    nn   78  38
**[1283 rows x 1 columns]**
</code></pre>

<p>however the result give me a "1000 rows * 1 columns" Dataframe. SO my question is if Groupby concatenate columns as one Column? if yes how can I prevent that. I want to plot my data after grouping it but i can't since it only see one column instead of all 4.</p>

<p>edit: when i call the columns i only get the last column, it means it can't read 'a','b','c' as columns, why is that and how can i markl them as column again.</p>

<pre><code>df.columns
Index([u'd'], dtype='object')
</code></pre>

<p>you can do it this way:</p>

<pre><code>df.groupby(['a','b','c'], as_index=False).sum()
</code></pre>

<p>or:</p>

<pre><code>df.groupby(['a','b','c']).sum().reset_index()
</code></pre>

python pandas