I would like to calculate average or std value every 5 rows in specific column and **select data (first or last or all or some data that I choose)** from another column by using pandas with python 2.7

This is my dataframe (example) :

```
>>df
       DateTime     Product     Location       Value       Place
0    12-07-2018           A           S1       1.313       601
1    12-07-2018           B           S1       3.089       601/14
2    12-07-2018           C           S1       1.890       601
3    12-07-2018           D           S1       3.136       601
4**  12-07-2018           E           S1       3.258       601/15
5    13-07-2018           F           S1       3.113       601
6    13-07-2018           G           S1       2.651       601/12
7    13-07-2018           H           S1       2.135       601
8    13-07-2018           I           S1       1.555       602
9**  14-07-2018           J           S1       2.009       602
10   14-07-2018           K           S1       1.757       602
11   14-07-2018           L           S1       1.808       602/11
12   14-07-2018           M           S1       1.511       603/10
13   15-07-2018           N           S1       2.265       603
14** 15-07-2018           O           S1       2.356       603
15   15-07-2018           P           S1       2.950       603/09
16   15-07-2018           Q           S1       3.300       603/09

```

Now I can average value every 5 rows and select data from "DateTime","Place" column (first or last) by use this code(**example. average and select last**) :

```
new_df = df[:(len(df)//5)*5].groupby(df[:(len(df)//5)*5].index // 5).agg({'DateTime':'last', 'Value':'mean', 'Place':'last'})

```

This is result of average value every 5 rows and select last data (**example. average and select last**) :

```
>> new_df
     DateTime       Value     Place
0  12-07-2018      2.5372     601/15
1  14-07-2018      2.2926     602
2  15-07-2018      1.9394     603

```

If I want result same this (average, select last and all): 

```
>> new_df
     DateTime   Product      Value      Place
0  12-07-2018   A,B,C,D,E    2.5372     601, 601/14, 601, 601, 601/15
1  14-07-2018   F,G,H,I,J    2.2926     601, 601/12, 601, 602, 602 
2  15-07-2018   K,L,M,N,O    1.9394     602, 602, 602/11, 603/10, 603

```

and (average, select some data)

```
>> new_df
     DateTime   Product      Value      Place
0  12-07-2018   A,C,E        2.5372     601, 601/14, 601
1  14-07-2018   F,G          2.2926     601, 601/12
2  15-07-2018   L,M,N,O      1.9394     602/11

```

Can pandas do this ???

**Note : I add \*\* for easy to observe at every 5 rows.**