I'm working on a program whose goal is to make a playlist that "flows" nicely. To do this, I obtain for each song a list of the genres it belongs to from Spotify. I've assumed that the order of this list heuristically goes from "bigger" genres to "nicher" genres. Effectively, my data structure here is a list of list of strings [["rock", "American rock", "synth rock"], ["rock", "French rock", "synth rock"], ["pop", "rock", "alt rock"]]. Now, in order to figure out how to order my playlist, I need a "consensus sequence" of all the genres. Because I have a computational biology background, my first thought was to try to align these lists together and obtain a consensus from that alignment. Do you know of any packages that implement such an algorithm on sets of strings rather than DNA/RNA/Protein alphabets in python? Thank you. Continue reading...