I read ReplaceOrRemoveInvalidOrMissingData Mathematica documentation, and I tried to apply the same approach to my dataset.
I've got two problems, but one is only a style problem!
There is one more elegant way to select numeric data in a large dataset? I mean that I've got a dataset o 29 possible numeric value and 2 columns that are not numerical. So I tried this way.
baddata[entry_] := Not[MatchQ[ entry, {_?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, _?NumberQ, __}]] DeleteCases[data, _?baddata];
It works, but it is not so elegant!
2 . I would accept some non numerical (e.g. blank values) values in some columns (e.g. the first, the twelfth and the twentieth). How can I modify this algorithm? Thanks in advance.
EDIT
Your answers are very useful for me, and I'm wondering how all of you use Mathematica in a very smart way! For my first question it's very clear all your solutions, but, it is not clear for me (surely I didn't explain in a right way my problem) if I've got this kind of dataset
mydataset={{1, 2, 3, 4}, {3, 4, 5, 4}, {1, "", 3, 4}, {10, "", 12, 13}, {20, 30,
40, ""}, {100, 200, 300, ""}};
I want to select the row in this way: I can admit blank entries for the second column, but not for the fourth column. So the result would be:
result={{1, 2, 3, 4}, {3, 4, 5, 4}, {1, "", 3, 4}, {10, "", 12, 13}}
Can I modify your algorithm in this way? Thanks again, and sorry!
Cases[data, _?NumberQ]for a list. – ciao Mar 18 '14 at 22:15