``{k:pmf[k][category] for k in pmf if pmf[k][category]}``

the call to ``.keys()`` is wasteful