08-17-2023 02:20 PM
Hello,
How do I go about extracting unique non-zero data from a column based on data in the first column.
In the attached CSV file, the data looks like:
Cold Start Test @ 22.4 °C | |||
cold start #1 | |||
index | Start type | Test1 | Test2 |
1 | cold start | 46.67 | 491.394 |
2 | cold start | 46.67 | 491.394 |
3 | cold start | 0 | 0 |
4 | cold start | 0 | 0 |
5 | cold start | 0 | 0 |
6 | cold start | 0 | 0 |
....
26 | cold start | 0 | 0 |
27 | cold start | 0 | 0 |
28 | cold start | 70.17 | 24.948 |
29 | cold start | 70.08 | 24.948 |
30 | cold start | 70.08 | 24.948 |
cold start #2 | |||
index | Start type | Test1 | Test2 |
1 | cold start | 72.42 | 24.948 |
2 | cold start | 0 | 0 |
3 | cold start | 0 | 0 |
4 | cold start | 0 | 0 |
5 | cold start | 0 | 0 |
6 | cold start | 0 | 0 |
7 | cold start | 0 | 0 |
... (see attached csv file for more details)
How can I go about getting the non zero numbers from column 3 starting after index 4?
Thanks!
08-18-2023 01:42 AM
Hi hiNI,
@hiNI wrote:
How do I go about extracting unique non-zero data from a column based on data in the first column.
How can I go about getting the non zero numbers from column 3 starting after index 4?
Now you get all non-zero values from column 3 - you may filter for "unique" elements when needed.
08-18-2023 04:32 AM
@GerdW wrote:
Hi hiNI,
@hiNI wrote:
How do I go about extracting unique non-zero data from a column based on data in the first column.
How can I go about getting the non zero numbers from column 3 starting after index 4?
- Read the CSV file as array of strings using ReadDelimitedSpreadsheetFile.
- Find the row with "index=4" and continue to use the ArraySubset after that row.
- Get column 3 as 1D array.
- Use an autoindexing FOR loop with a conditional output tunnel to filter any string elements different to "empty", "0", or "Test*".
Now you get all non-zero values from column 3 - you may filter for "unique" elements when needed.
a set will filter automatically all unique values, when you add them into the set
and it will sort in an ascending order