For a given list, say {94,35,47,29,86,40,46,72,87}, how can I havefind a list of even and odd numbers.
GroupBy[{94,35,47,29,86,40,46,72,87,84,49,82,100,99,7,70,67,63,13,
91,18,94,94,15,72,39,4,7,31,67,65,37,93,9,4,84,97,60,48,61,91,24,10,
46,42,28,41,36,62,70,78,38,80,70,63,20,21,7,54,26,17,73,100,56,36,
54,100,46,0,59,77,80,57,82,63,74,8,47,68,74,54,57,4,90,14,31,88,23,
30,37,95,44,100,12,23,48,4,14,100,57},EvenQ]
True-> {94,86,40,46,72,84,82,100,70,18,94,94,72,4,4,84,60,48,24,10,46,
42,28,36,62,70,78,38,80,70,20,54,26,100,56,36,54,100,46,0,80,
82,74,8,68,74,54,4,90,14,88,30,44,100,12,48,4,14,100},
False-> {35,47,29,87,49,99,7,67,63,13,91,15,39,7,31,67,65,37,93,9,97,
61,91,41,63,21,7,17,73,59,77,57,63,47,57,31,23,37,95,23,57}\
What is needed is the count.True True->54,False False->49.
With CountsBy as suggested by @sjoerd-smit, I get the count of even and odd numbers in one command. CountsBy[{94,35,47,29,86,40,46,72,87,84,49,82,100,99,7,70,67,63,13,91,18,94,94,15,72,39,4,7,31,67,65,37,93,9,4,84,97,60,48,61,91,24,10,46,42,28,41,36,62,70,78,38,80,70,63,20,21,7,54,26,17,73,100,56,36,54,100,46,0,59,77,80,57,82,63,74,8,47,68,74,54,57,4,90,14,31,88,23,30,37,95,44,100,12,23,48,4,14,100,57},EvenQ]
CountsBy[{94,35,47,29,86,40,46,72,87,84,49,82,100,99,7,70,67,63,13,
91,18,94,94,15,72,39,4,7,31,67,65,37,93,9,4,84,97,60,48,61,91,24,10,
46,42,28,41,36,62,70,78,38,80,70,63,20,21,7,54,26,17,73,100,56,36,
54,100,46,0,59,77,80,57,82,63,74,8,47,68,74,54,57,4,90,14,31,88,23,
30,37,95,44,100,12,23,48,4,14,100,57},EvenQ]
Input: Median[{35,47,29,87,49,99,7,67,63,13,91,15,39,7,31,67,65,37,93,9,97,61,91,41,63,21,7,17,73,59,77,57,63,47,57,31,23,37,95,23,57}]
Median[{35,47,29,87,49,99,7,67,63,13,91,15,39,7,31,67,65,37,93,
9,97,61,91,41,63,21,7,17,73,59,77,57,63,47,57,31,23,37,95,23,57}]