Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAtough one in python, pretty straight forward in Alteryx though 🙂
from ayx import Alteryx
import pandas as pd
import numpy as np
data = Alteryx.read('#1')
data['hashtags'] = data['text'].str.findall('(#\w+)').astype(str).str.replace('[','').str.replace(']','').str.replace("'",'')
data = pd.concat([pd.Series(row['id_str'], row['hashtags'].split(','))
for _, row in data.iterrows()]).reset_index()
data = data.rename(columns={'index':'hashtags', 0:'id_str'})
data['hashtags'] = data['hashtags'].str.replace(' ','')
data = data[data['hashtags']!=u'']
data = pd.crosstab(data.hashtags, data.id_str).reset_index()
data
#SnakingMyWayThruChallenges
Interesting to see all the different approaches to solve this challenge.