Skip to content

Instantly share code, notes, and snippets.

@docmarionum1
Last active December 24, 2017 19:47
Show Gist options
  • Save docmarionum1/7b056d365c2ad555317d118a47e70563 to your computer and use it in GitHub Desktop.
Save docmarionum1/7b056d365c2ad555317d118a47e70563 to your computer and use it in GitHub Desktop.
Codenames 2
df = pd.read_csv(
'dictionary/conceptnet-assertions-5.5.5.csv.gz',
sep='\t', header=None,
names=['uri', 'relation', 'from', 'to', 'json']
)
df = df[['from', 'json']].drop_duplicates(subset='from')
df = df[(df['from'].str.extract(r'/./([^/]*)/.*') == 'en')]
df['from'] = df['from'].str.extract(r'/./[^/]*/([^/]*).*')
df = df[
df['json'].str.contains('verbosity') |
df['json'].str.contains('/d/wiktionary/en')
]
words = df['from']
words = words[~words.str.contains('_')].drop_duplicates()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment