I have a data table where I want to remove the rows that have no values in all the columns for a variable range of columns.
For example, for the data table below:
dt =
| Sample | Product Type | Col1 | Col2 | Col3 | Col4 | Col5 |
| 10001 | A | 0.0122 | 0.0223 | 0.01546 | 0.8742 | 23.12 |
| 10003 | B | | | | | |
| 10004 | A | 0.123 | 0.124 | 0.1240 | 0.9712 | 23.78 |
I would want to drop the row with sample '10003' because it's entries in Col1 - Col5 are empty. I know this post is very similar, but it's not very helpful for me because the number of columns that I want to check are empty are usually greater than 15 and the column names can/will change, so it's not practical to manually type out this code and adjust the column names
dt << Select Where(
Is Empty(:Col1) &
Is Empty(:Col2) &
is Empty(:Col3) & ... etc.
) << Delete Rows;I am able to pretty easily get all the columns that I need to check are empty in a list because they are/will all be continuous with
cols = dt << Get Column Names(Continuous);
But this is where I get stuck and am unsure how to proceed. Do I use a for loop to go through each column and check if it's empty? But I only want to drop rows where ALL the columns are empty in the range of columns. If I was using Python, I would just use pandas.DataFrame.dropna(axis=0). How would I do this in JMP?