Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import re
import matplotlib.pyplot as plt
with open('chat.txt', 'r') as f:
content = f.readlines()
all_dates = []
for line in content:
dates = re.findall(r'[0-9]+/[0-9]+/[0-9]+', line)
if dates:
unique_dates = list(set(all_dates))
tuple_date_freq_list = []
for date in unique_dates:
freq = all_dates.count(date)
tuple_date_freq_list.append((date, freq))*zip(*tuple_date_freq_list))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.