Created
August 21, 2020 08:02
-
-
Save hiepph/945b0f26fae4ff011d3818652ef1d468 to your computer and use it in GitHub Desktop.
Get set of unique characters from a list of strings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dask.bag as db | |
labels = ["abc", "abd", "bcd"] | |
b = db.from_sequence(labels) | |
def join_2_set(a, b): | |
return set(a) | set(b) | |
char_sets = b.map(set).fold(join_2_set).compute() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment