Ordering events in a table

1 view (last 30 days)
Queena Edwards
Queena Edwards on 1 Apr 2022
Commented: Queena Edwards on 1 Apr 2022
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 Comments
Walter Roberson
Walter Roberson on 1 Apr 2022
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 ?
Queena Edwards
Queena Edwards on 1 Apr 2022
Is it possible to have two independent periods on the same day? If so are they to be treated separately? Yes
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? There aren't any pauses in the data. They look similar to what was posted where for an event between the NaN there can be 0 rainfall in between hours of rainfall
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 ? Yes

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!