lundi 5 mars 2018

Fetching records and then putting in a new column

I am working with Pandas data frame for one of my projects.

I have a column name Count having integer values in that column.

I have 720 values for each hour i.e 24 * 30 days.

I want to run a loop which can get initially first 24 values from the data frame and put in a new column and then take the next 24 and put in the new column and then so on.

for example:

input:

34
45
76
87
98
34

output:

34   87
45   98
76   34

here it is a row of 6 and I am taking first 3 values and putting them in the first column and the next 3 in the 2nd one.

Can someone please help with writing a code/program for the same. It would be of great help.

Thanks!

Aucun commentaire:

Enregistrer un commentaire