I have data stored in DoubleTimeSeries as:
DoubleTimeSeries width = DoubleTimeSeries.getDoubleTimeSeries(connection, userId, "Width");
DoubleTimeSeries height = DoubleTimeSeries.getDoubleTimeSeries(connection, userId, "Height");
and I am adding the above results into ArrayList as:
ArrayList<String> myArray = new ArrayList<>();
for (int i = 0; i < width.size(); i++) {
myArray.add(width.get(i) + "," + height.get(i) );
}
System.out.println("My Array: \n" + myArray);
My issue: Some of the width or height value is empty (it is NaN) in my file and when i am adding them into my ArrayList, I am getting such as:
[NaN,NaN, 25,50, 55, 60, NaN,NaN, 45,56]
Now: How I can prevent (or ignore) these NaN values from adding into my ArrayList. I want the ArrayList results as:
[25,50, 55, 60, 45,56]
Thanks