<jupyter_start><jupyter_text><jupyter_code>from google.colab import drive
drive.mount('/content/drive/')
import os
os.chdir('/content/drive/My Drive')
!ls
import re
import pandas as pd
pattern = r'([a-zA-Z\s]+):(.+)'
data = {
    'name': [],
    'line': []
}
with open('Friends-The-Blackout.txt', 'rt') as file:
  for line in file.readlines():
    match = re.findall(pattern, line)
    if match:
      name, line = match[0]
      data['name'].append(name)
      data['line'].append(line)
df = pd.DataFrame(data)
df.head()
sum(df['name'] == 'Chandler')
len(df)
df.to_csv('TheBlackout.csv', index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.196513470681458, 'fraction_numerical': 0.001584786053882726, 'mean_word_length': 4.3559322033898304, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '260966', 'license': 'MIT', 'n_tokens_mistral': 246, 'n_tokens_neox': 241, 'n_words': 48, 'path': 'parse_script.ipynb', 'repo_name': 'hilfiger1/ChattingWithChandler', 'size': '631'}