Thank You for the explanations.
I found this counter implementation is really cool and easily adaptable to more
solutions.
Thanks
Alternatively collections.Counter() supports an arbitrary number of bins...
import collections
freq = collections.Counter(t[1] for t in stats)
freq
Sayth Renshaw wrote:
why can't I filter a list based on an itertools condition using dropwhile?
This is the docs and the example.
https://docs.python.org/3/library/itertools.html#itertools.dropwhile
def less_than_10(x):
return x 10
itertools.takewhile(less_than_10,
On 2015-05-12 23:43, Sayth Renshaw wrote:
why can't I filter a list based on an itertools condition using dropwhile?
This is the docs and the example.
https://docs.python.org/3/library/itertools.html#itertools.dropwhile
def less_than_10(x):
return x 10
itertools.takewhile(less_than_10,
why can't I filter a list based on an itertools condition using dropwhile?
This is the docs and the example.
https://docs.python.org/3/library/itertools.html#itertools.dropwhile
def less_than_10(x):
return x 10
itertools.takewhile(less_than_10, itertools.count()) =
0, 1, 2, 3, 4, 5, 6,