Given two arrays:
double[] a = new double[]{1.0, 2.0, 3.0};
bool[] b = new bool[]{true, false, true};
Is there an easy way to choose abased on b? In R and other scripting languages, you say:
a[b]
to get {1.0, 3.0}. I can't figure out if there is a clean (without explicit loops) way in C # to do this. Maybe I should organize my data in a different way?
source
share