Group index in dataframe
#### Code Sample, python code with name "post_demo.py"

```
import argparse
import pandas as pd
import os

if __name__ == "__main__":

#Read command line options

    parser = argparse.ArgumentParser(description="Postprocessing tool")
    
    parser.add_argument("csvfile", metavar = "--DATA", help="Parse the csv file into program")


options = parser.parse_args()

print("Reading in data...")
print("=================================================================================================") 

#Use columns names for the dataframe
columns = ["file","kernel","launch","measurement","t","p"]

#Create dataframe
DATA = pd.read_csv(options.csvfile, delimiter=',', header=None, names=columns)

#Delete all the duplicated headers
DATA = DATA[DATA.file != 'kernel_file']

#Group sequentially data which have the same file name into different dataframes
df_list = [x[1] for x in DATA.groupby((DATA.file!=DATA.file.shift()).cumsum())]

print("Processing data...")
#Loop over each dataframe which has different filename
for idx in range(len(df_list)):
    Grouped_Data = df_list[idx].groupby("launch")
    #Loop over all the existed groups, basically it is going over all launches
    for i, group in Grouped_Data:
        print(i)

```

#### A csv file is needed as input to python code with name energy_demo.csv


```
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,0,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,1,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,2,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,3,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,4,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,5,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,6,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,7,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,8,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,9,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,10,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,11,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,12,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,13,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,14,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,15,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,16,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,17,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,18,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,19,0,0, 0
kernel_file,kernel_name,launch_seq,measuement_seq,time,power
3DConvolution,convolution3D_kernel,20,0,0, 0
```


#### To run it, you need the following command: "python3 post_demo.py energy_demo.csv"


#### Printed info

```
Reading in data...
=================================================================================================
Processing data...
0
1
10
11
12
13
14
15
16
17
18
19
2
20
3
4
5
6
7
8
9
```





#### Expected Output
```
Reading in data...
=================================================================================================
Processing data...
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

```

<details>
Finally, all the groups are shown. But their sequence is not the expected one. Any help, why this happens is welcome
.
I am using the 0.23.4 pandas version and ubuntu 16.04.

Let me know if you need more info.


</details>
