Message Boards Message Boards

1
|
4176 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

Get an overlapping interval of a set of time intervals

I generate a set of time series data during the data analysis process. Want to know the time period(overlay interval) common to all-time series. What should I do the fastest?

dateRange = {DateInterval[{{{2019, 8, 25, 7, 3, 39.}, {
      2019, 11, 1, 7, 56, 11.}}}, "Instant", "Gregorian", 8.], 
   DateInterval[{{{2019, 8, 25, 7, 3, 58.}, {
      2019, 11, 1, 7, 58, 18.}}}, "Instant", "Gregorian", 8.], 
   DateInterval[{{{2019, 8, 25, 7, 2, 36.}, {
      2019, 11, 1, 7, 57, 2.}}}, "Instant", "Gregorian", 8.], 
   DateInterval[{{{2019, 8, 25, 7, 2, 28.}, {
      2019, 11, 1, 7, 56, 32.}}}, "Instant", "Gregorian", 8.], 
   DateInterval[{{{2019, 8, 25, 7, 5, 49.}, {
      2019, 11, 1, 7, 54, 10.}}}, "Instant", "Gregorian", 8.], 
   DateInterval[{{{2019, 8, 25, 7, 0, 12.}, {
      2019, 10, 30, 10, 35, 22.}}}, "Instant", "Gregorian", 8.], 
   DateInterval[{{{2019, 8, 25, 7, 0, 57.}, {
      2019, 11, 1, 7, 55, 0.}}}, "Instant", "Gregorian", 8.]};

I tried IntervalIntersection@dateRange The result is not as expected.

Attachments:
POSTED BY: Tsai Ming-Chou
Posted 4 years ago

The problem is that IntervalIntersection expects the intervals as separate arguments, not a List of intervals. Try

IntervalIntersection @@ dateRange
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract