I have a function that cycles through two sperate lists and combines them into one as follows:
spread = Table[{gld[[i, 1]], (gld[[i, 2]] - gdx[[i, 2]]) },
{i, 1, Length[gld], 1}]
This works fine, and generates answers in the form:
{{2009, 6, 1}, 52.72}
But when I add a subtraction, as follows:
spread = Table[{gld[[i, 1]], (gld[[i, 2]] - gdx[[i, 2]]) - meanspread },
{i, 1, Length[gld], 1}]
I get answers in the format:
{{2009, 6, 1}, {-20.2896}}
This causes issues when I want to use DateLinePlot (all the data is in the extreme right of the graph, and the graph is not usable.
Can anyone suggest what might be happening here and how I may avoid it?
Thanks!
Most likely
meanspreadis not a number, but a single-item list, such as{1.1}. It’s impossible to tell without knowing more details and having a sample of all data/variables you’re using.