This file contains hidden or 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
| commond_words = chat[['Author','Message']].copy() | |
| from nltk.corpus import stopwords | |
| STOPWORDS = stopwords.words('spanish') | |
| stopwords = list(STOPWORDS) | |
| extra = ["<multimedia", "omitido>", "k", "d","si","multimedia", "omitido"] | |
| stopwords = stopwords + extra | |
| commond_words["Message"] = (commond_words["Message"] | |
| .str.lower() |
This file contains hidden or 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
| weekday_grouped_msg = (chat.set_index('weekday')['Message'] | |
| .groupby(level=0) | |
| .value_counts() | |
| .groupby(level=0) | |
| .sum() | |
| .reset_index(name='count')) | |
| weekday_grouped_msg | |
| fig = px.line_polar(weekday_grouped_msg, r='count', theta='weekday', line_close=True) | |
| fig.update_traces(fill='toself') |
This file contains hidden or 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
| def split_count(text): | |
| emoji_list = [] | |
| data = regex.findall(r'\X', text) | |
| for word in data: | |
| if any(char in emoji.UNICODE_EMOJI for char in word): | |
| emoji_list.append(word) | |
| return emoji_list | |
| chat["emoji"] = chat["Message"].apply(split_count) |
This file contains hidden or 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
| def startsWithDateAndTime(s): | |
| pattern = '^\d{1,2}/\d{1,2}/\d{1,2}, \d{1,2}:\d{1,2}\S [AaPp][Mm] -' | |
| result = re.match(pattern, s) | |
| if result: | |
| return True | |
| return False | |
| def FindAuthor(s): | |
| patterns = [ | |
| '([\w]+):', # Nombre |