I have a data that contains temperature values after every 15 minutes(4 values for each hour). I wanted to create json that stores 96 arrays(4*24) of temperature data for each day. This is my data
22-10-2018,01:00:00,7.6,Station1
22-10-2018,01:15:00,9.0,Station1
22-10-2018,01:30:00,6.3,Station1
22-10-2018,01:45:00,4.1,Station1
22-10-2018,02:00:00,4.5,Station1
22-10-2018,02:15:00,7.3,Station1
22-10-2018,02:30:00,6.1,Station1
..
..
..
23-10-2018,01:30:00,6.3,Station2
23-10-2018,01:45:00,4.1,Station2
23-10-2018,02:00:00,4.5,Station2
23-10-2018,02:15:00,7.3,Station2
23-10-2018,02:30:00,6.1,Station2
I wanted my json to be like
{ Station: Station1,
Date: 22-10-2018,
Time:[01:00:00:{temperature:7.6},01:15:00:{temperature:9.0}...]
},
{ Station: Station2,
Date: 23-10-2018,
Time:[01:30:00:{temperature:6.3},01:35:00:{temperature:4.0}...]
}..
I am totally new to python and don't know how to iterate between dates and minutes. Any help is highly appreciated.