<jupyter_start><jupyter_text>Analysing Episode Descriptions<jupyter_code>import pandas as pd
import numpy as np
import json
import matplotlib.pyplot as plt
import seaborn as sns
import nltk
from nltk.tokenize import sent_tokenize, word_tokenize
df = pd.read_csv('top_podcasts.csv',index_col=0)
df
df.isnull().any()
df.dropna(inplace=True)
df.isnull().any()
search_values = ['bitcoin', 'cryptocurrency']

df_a = df[df.ep_description.str.contains('|'.join(search_values ))]
df_a
df_a['show_name'].value_counts() #how many episodes of each show have thes terms in their descriptions?
plt.figure(figsize=(20,10))
sns.barplot(df_a['show_name'],df_a['ep_duration'])
plt.xlabel('Show',fontsize=20)
plt.ylabel('Episode duration',fontsize=20)
plt.savefig('crypto_ep.png');
df_a['tokenized'] = df_a['ep_description'].apply(word_tokenize)
df_a
ep_descr = df.reset_index(drop=True)

text = df['ep_description'].str.lower()
text = text.str.replace('\d+', '')
text = text.astype('str')
text
filtered_ep = {k:v for k,v in text.items() if 'bitcoin' in v}
filtered_ep
df.isnull().any()
descr = pd.DataFrame(filtered_ep.items())
descr
descr.drop([0],axis=1,inplace=True)
descr
descr.shape
descr.to_csv('descr.csv')
df_text = pd.read_csv('descr.csv',enc)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15810276679841898, 'fraction_numerical': 0.008695652173913044, 'mean_word_length': 7.731034482758621, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '440560', 'license': 'MIT', 'n_tokens_mistral': 504, 'n_tokens_neox': 490, 'n_words': 91, 'path': 'Analysing Episode Descriptions.ipynb', 'repo_name': 'sukanto-m/Spotify_Finance_Podcasts', 'size': '1265'}