-1
Hello!
I am working on a data_set in which the time measure is in Total Hours Races of the month. Going from hour 1 to hour 734. I want to convert this measure of time into hours of the month per day.
For example:
- Input:
step = [1, 2, 3, 22, 23, 24, 25, 26, 27, 46, 47, 48, 49, 50]
- Outputs:
hour = [1, 2, 3, 22, 23, 0, 1, 2, 3, 22, 23, 0, 1, 2]
for s in step:
i = 1
upper_range_hour = i*24
lower_range_hour = upper_range_hour-24
if (s >= lower_range_hour) & (s < (upper_range_hour)):
if s < 24:
hour.append(s)
else:
hour.append(s%lower_range_hour)
else:
hour.append(0)
i += 1
But the return I have is the following for this example: [1, 2, 3, 22, 23, 0, 0, 0, 0, 0, 0, 0]
Can anyone help me? I think the problem is perhaps the sum of "counted i" OR "hour.append(s%lower_range_hour)"
Thank you!
"where the time measure is in hours of the month" and then "I want to convert that time measure into hours of the month". I think it’s a little controversial. You can edit the question? :)
– vinibrsl