{ Snipperize } /group

Snippets about group

Here are the latest snippets talking about group. Please choose your favorite one or add a new one.

Sort List By Similar Group

This function takes a list of string and sorts them based on their similarity. The percent at which they match can be defined in the second parameter (default 75%). # Example: random = [ 'bob1', 'frank2', 'bob3', 'joe2', 'frank1', 'bob2', 'joe1', 'joe3' ] groups = sortByGroup(random) for g in groups: for i in g: print i print '-' * 30 # Example Output: bob1 bob2 bob3 ------------------------------ frank1 frank2 ------------------------------ joe1 joe2 joe3 ------------------------------

Python / sort, list, group, similarity / by ThePeppersStudio (200 days, 6.69 hours ago)

  • 1