2
$\begingroup$

I'm not able to figure out how the undocumented command TemporalData`DropTimes described here works. For example, I have TemporalData like

temp = TemporalData[{{1, 1}, {2, 4}, {3, 9}}]

and want to get rid of the last point, but

TemporalData`DropTimes[temp, 3]

doesn't do anything. Anyone have any ideas, either using DropTimes or otherwise?

$\endgroup$
  • $\begingroup$ try temp = TemporalData`DropTimes[temp, 3]; temp? $\endgroup$ – kglr Jul 24 '16 at 21:57
  • $\begingroup$ Do you need to trim events off of the start and end or delete events in the middle? $\endgroup$ – Edmund Jul 25 '16 at 1:09
  • 1
    $\begingroup$ @kglr no, that doesn't work either $\endgroup$ – Chris K Jul 25 '16 at 3:09
  • $\begingroup$ @Edmund, I'd like to remove the last event. $\endgroup$ – Chris K Jul 25 '16 at 3:10
  • 1
    $\begingroup$ Also it seems like that internals have been changed since v.9 because some examples in the link thread are not working anymore. $\endgroup$ – István Zachar Jul 25 '16 at 7:57
1
$\begingroup$

You may use TimeSeriesWindow.

TimeSeriesWindow[temp, {1, 2}]

(* TemporalData[Time: 1 to 2 Data points: 2 Paths: 1] *)

TimeSeriesWindow gives the events the fall between the window specified.

Hope this helps.

$\endgroup$
  • $\begingroup$ This is great, and even a documented command! $\endgroup$ – Chris K Jul 25 '16 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.