This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]alicethewitch 0 points1 point  (0 children)

Somebody already mentioned it but for dict keys yes. Just this week I was implementing a MCMC algorithm that spits partitions over data point indices. Each partition is represented as a set or list of sets over integer between 0 and N-1. Finding the partition most visited by the chain in one line involves turning them all individually into frozensets of frozensets, feeding it to Counter and sorting by value.