07-10-2024 10:33 AM
I am receiving excel tables with an undefined number of rows and columns with every column, excluding the first, containing missing data values. I would like to loop each column (starting with the second) and linearly interpolate each missing value based only on the most recent value and the next available value. This VI must be able to handle multiple missing data points in a row.
Is there any efficient built-in VIs to accomplish this task? I have looked into the 1d interpolate vi, but it does not seem to perform in the way that I would like.
Attached is a snippet of what an excel table might look like.
Solved! Go to Solution.
07-10-2024 10:38 AM
LabVIEW does not have an out-of-the-box way to do this easily. You will need to implement the looping to apply the interpolate functions.
Pandas library in Python has an easy way to do this.
07-10-2024 11:20 AM - edited 07-10-2024 11:23 AM
That seems like a trivial task and all you need to do is write code that handles one column, then iterate over all columns.
You said that the first column does not have missing values, but that's not true for your datafile. Is the first column the x-value for all columns? Can you attach a datafile that follows your description?
What should be done with the columns that don't have a first point and linear interpolation is not possible there.
07-10-2024 11:41 AM - edited 07-10-2024 11:53 AM
Here is a quick example. It will pad early and late missing points with the closest.
(I exported the excel file as text. and we need to read it as tab delimited array of strings to be able to distinguish an empty string from a true numeric zero).
Description: