Message Boards Message Boards

0
|
5665 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

NA handling in TimeSeries["Date"] ... “0. + NA” ?

Posted 8 years ago

I have an issue with the handling of TimeSeries, which is best described by the following MWE:

data = Import["https://pastebin.com/raw/Xj6x3PSe"];
dates = Table[DateList[{StringTake[data[[k, 1]], 10], {"Day", "Month","Year"}}], {k, 2, Length[data]}];
tsdata = TimeSeries[data[[2 ;;, 2 ;;]], {dates}];
tsdata["August 26, 2008"]

The resulting output is:

{6.67345,6.55845,7.46281,7.32023,6.89391,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,1.82743,1.77073,1.65871,1.56591,1.52516,1.46369,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,1.47368,1.57085,1.65731,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,1.18979,1.02756,1.08294,1.12263,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA,0. +NA}

However, it should be:

tsdata["Values"][[7, ;;]]

{6.67345,6.55845,7.46281,7.32023,6.89391,NA,NA,NA,NA,NA,NA,1.82743,1.77073,1.65871,1.56591,1.52516,1.46369,NA,NA,NA,NA,NA,NA,NA,1.47368,1.57085,1.65731,NA,NA,NA,NA,NA,NA,1.18979,1.02756,1.08294,1.12263,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA}

I can't figure out what causes this behaviour. Any suggestion is much appreciated.

(I'm using Mathematica 11.0.1.0)

For reference, I raised the same question on Mathematica Stackexchange.

POSTED BY: Fabian Wo
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