Ordering events in a table
1 次查看(过去 30 天)
显示 更早的评论
I have the following table of rainfall events separated by NaN.
Date Time (Hours) NumOfHours Total Rainfall(mm)
___________ ____________ __________ __________________
NaT NaN NaN 6
06-Apr-2019 09:00:00 1 1.02
06-Apr-2019 10:00:00 2 0.51
06-Apr-2019 11:00:00 3 0.25
NaT NaN NaN 7
17-Apr-2019 03:00:00 1 0.51
17-Apr-2019 04:00:00 2 0
17-Apr-2019 05:00:00 3 0
17-Apr-2019 06:00:00 4 0.25
17-Apr-2019 07:00:00 5 0.25
NaT NaN NaN 8
29-Apr-2019 08:00:00 1 0.76
29-Apr-2019 09:00:00 2 0.25
NaT NaN NaN 9
02-May-2019 22:00:00 1 3.3
02-May-2019 23:00:00 2 0
03-May-2019 00:00:00 3 0
03-May-2019 01:00:00 4 0.25
NaT NaN NaN 10
03-May-2019 16:00:00 1 1.02
03-May-2019 17:00:00 2 0.51
NaT NaN NaN 11
05-May-2019 06:00:00 1 0.76
NaT NaN NaN 12
13-May-2019 16:00:00 1 1.52
I would like to order the events based on the total number of hours in numerical order (and subsequently chronologinal order based on the date). So it looks like:
Date Time (Hours) NumOfHours Total Rainfall(mm)
___________ ____________ __________ __________________
NaT NaN NaN 11
05-May-2019 06:00:00 1 0.76
NaT NaN NaN 12
13-May-2019 16:00:00 1 1.52
NaT NaN NaN 10
03-May-2019 16:00:00 1 1.02
03-May-2019 17:00:00 2 0.51
NaT NaN NaN 8
29-Apr-2019 08:00:00 1 0.76
29-Apr-2019 09:00:00 2 0.25
NaT NaN NaN 6
06-Apr-2019 09:00:00 1 1.02
06-Apr-2019 10:00:00 2 0.51
06-Apr-2019 11:00:00 3 0.25
NaT NaN NaN 9
02-May-2019 22:00:00 1 3.3
02-May-2019 23:00:00 2 0
03-May-2019 00:00:00 3 0
03-May-2019 01:00:00 4 0.25
NaT NaN NaN 7
17-Apr-2019 03:00:00 1 0.51
17-Apr-2019 04:00:00 2 0
17-Apr-2019 05:00:00 3 0
17-Apr-2019 06:00:00 4 0.25
17-Apr-2019 07:00:00 5 0.25
2 个评论
Walter Roberson
2022-4-1
Is it possible to have two independent periods on the same day? If so are they to be treated separately?
Your 02-May-2019 has readings of 0 0 inside it, implying that the situation I ask about above has already been taken care of, that pauses inside any one day are present as 0 in the data?
I see there also an answer to another question I had, about what happens if the data spans more than one day; I see it just continues and should be treated as a continuation ?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!