3 replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
source | link

In recent versions I would turn to GroupBy for this:

GroupBy[data, Length] /@ {3, 5}

Note: Lookup can be somewhat fastersomewhat faster than Map.

If memory consumption is a concern consider using the older Sow and Reap as you can preselect the targets, e.g. Reap[Sow[#, Length@#] & ~Scan~ data, {3, 5}][[2, All, 1]] See http://mathematica.stackexchange.com/questions/6415/defining-tags-in-reap/6429#6429Defining Tags in Reap.

In recent versions I would turn to GroupBy for this:

GroupBy[data, Length] /@ {3, 5}

Note: Lookup can be somewhat faster than Map.

If memory consumption is a concern consider using the older Sow and Reap as you can preselect the targets, e.g. Reap[Sow[#, Length@#] & ~Scan~ data, {3, 5}][[2, All, 1]] See http://mathematica.stackexchange.com/questions/6415/defining-tags-in-reap/6429#6429.

In recent versions I would turn to GroupBy for this:

GroupBy[data, Length] /@ {3, 5}

Note: Lookup can be somewhat faster than Map.

If memory consumption is a concern consider using the older Sow and Reap as you can preselect the targets, e.g. Reap[Sow[#, Length@#] & ~Scan~ data, {3, 5}][[2, All, 1]] See Defining Tags in Reap.

2 correction
source | link

In recent versions I would turn to GroupBy for this:

GroupBy[data, Length] /@ {3, 5}

Note: Lookup can be somewhat faster than Map.

If memory consumption is a concern consider using the older Sow and Reap as you can preselect the targets, e.g. Reap[Sow[#, Length@#] & /@~Scan~ data, {3, 5}][[2, All, 1]] See http://mathematica.stackexchange.com/questions/6415/defining-tags-in-reap/6429#6429.

In recent versions I would turn to GroupBy for this:

GroupBy[data, Length] /@ {3, 5}

Note: Lookup can be somewhat faster than Map.

If memory consumption is a concern consider using the older Sow and Reap as you can preselect the targets, e.g. Reap[Sow[#, Length@#] & /@ data, {3, 5}][[2, All, 1]] See http://mathematica.stackexchange.com/questions/6415/defining-tags-in-reap/6429#6429.

In recent versions I would turn to GroupBy for this:

GroupBy[data, Length] /@ {3, 5}

Note: Lookup can be somewhat faster than Map.

If memory consumption is a concern consider using the older Sow and Reap as you can preselect the targets, e.g. Reap[Sow[#, Length@#] & ~Scan~ data, {3, 5}][[2, All, 1]] See http://mathematica.stackexchange.com/questions/6415/defining-tags-in-reap/6429#6429.

1
source | link

In recent versions I would turn to GroupBy for this:

GroupBy[data, Length] /@ {3, 5}

Note: Lookup can be somewhat faster than Map.

If memory consumption is a concern consider using the older Sow and Reap as you can preselect the targets, e.g. Reap[Sow[#, Length@#] & /@ data, {3, 5}][[2, All, 1]] See http://mathematica.stackexchange.com/questions/6415/defining-tags-in-reap/6429#6429.