Tag Info

New answers tagged

11

One of the new operations on TimeSeries objects is TimeSeriesWindow. I think it does what you need. ts = WeatherData["KP60", "Temperature", {{2013, 7, 1}, {2013, 9, 30}}]; DateListPlot[TimeSeriesWindow[ts, {{2013, 8, 1}, {2013, 8, 14}}]]


4

It is not TimeSeriesWindow that is making your code slow. What is slowing down your function is the conversion of the data received from FinancialData from a List to a TimeSeries object. If this conversion is done before TimeSeriesWindow is applied, e.g. by tsData=TimeSeries[data] Than TimeSeriesWindow[tsData,{{2013,8,22},{2013,8,26}}] is even faster ...


1

I don't have MMA 10, so I can't reproduce TimeSeriesWindow. This is relatively fast: Cases[data, {{y_, m_, d_}, __} /; y >= 2013 && y <= 2013 && m >= 8 && m <= 8 && d >= 22 && d <= 26]; // Timing {0.031200, Null} DateInterval[data_, {y1_, m1_, d1_}, {y2_, m2_, d2_}] := Cases[data, {{y_, ...


5

Calling Wolfram|Alpha is not generally an efficient way to retrieve bulk data; where possible, it is better to use a built in data function. Part of the problem is figuring out what to submit to Wolfram|Alpha. In the code you supplied, the issue begins with Wolfram|Alpha returning Missing[NotAvailable]. WolframAlpha["AAPL ...



Top 50 recent answers are included