[post_stats] Python 3 compatibility

In Python 3, `filter()` returns an iterator instead of a list, which causes an error on line 42: "object of type 'filter' has no len()". Using a list comprehension fixes this, and is probably a little more readable.

This is an enhanced version of #231, as suggested by @avaris.