Ok, I have a big dataframe, for example:
hour value
0 0 1
1 6 2
2 12 3
3 18 4
4 0 5
5 6 6
6 12 7
7 18 8
8 6 9
9 12 10
10 18 11
11 12 12
12 18 13
13 0 14
Do not get lost here. The column hourrepresents the hours of the day, from 6 to 6 hours. The column is valuesgood, for sure, that here the values are given as an example, and not actual.
If you look closely at the column hour, you will see that the clock is missing. For example, there is a gap between lines 7 and 8 (there is no hour value 0). There are also large gaps, for example, between rows 10 and 11 (hours 00 and 06).
What I need? I would like to check when the hour (and, of course,) is missing, and fill in the DataFrame by inserting a row with the corresponding hour and np.nanas a value.
? , , 24, , 18 + 6 = 24 = 0 mod 24. , 6 , 24, , hour , , np.nan .
, python dataframe.
.