I have a table, testdata, with numeric and non-numeric data.
testData = {{1, 2, 3, no, 5}, {5, 6, 7, 8, 9.1}, {1, y, y, n, n}};
I can locate the positions of numeric data easily
goodloc = Position[testData, _?NumericQ]
(* {{1, 1}, {1, 2}, {1, 3}, {1, 5}, {2, 1}, {2, 2}, {2, 3}, {2, 4}, {2, 5}, {3, 1}} *)
I would like an equally simple means to locate non-numeric variables
I have been able to get this result by using this code
allPos = Flatten[Table[{i, j}, {i, 3}, {j, 5}], 1];
badloc = Complement[allPos, goodloc]
(* {{1, 4}, {3, 2}, {3, 3}, {3, 4}, {3, 5}} *)
Is there a single expression that will do this?
Complement[Flatten[MapIndexed[#2 &, testData, {2}], 1], Position[testData, _?NumericQ]]
$\endgroup$