<jupyter_start><jupyter_text>Rating average/count by day<jupyter_code>data['Day'] = data['Timestamp'].dt.date
day_average = data.groupby(['Day']).count()
day_average.head()
plt.figure(figsize=(25, 3))
plt.plot(day_average.index, day_average['Rating'])<jupyter_output><empty_output><jupyter_text>Rating average by week<jupyter_code>data['Week'] = data['Timestamp'].dt.strftime('%Y %U')
week_average = data.groupby(['Week']).mean()
plt.figure(figsize=(25, 3))
plt.plot(week_average.index, week_average['Rating'])<jupyter_output><empty_output><jupyter_text>Average rating by month<jupyter_code>data['Month'] = data['Timestamp'].dt.strftime('%Y-%m')
month_average = data.groupby(['Month']).mean()
plt.figure(figsize=(25, 3))
plt.plot(month_average.index, month_average['Rating'])<jupyter_output><empty_output><jupyter_text>Average rating by month by course<jupyter_code>data['Month'] = data['Timestamp'].dt.strftime('%Y-%m')
month_average_crs = data.groupby(['Month', 'Course Name'])['Rating'].mean().unstack()

month_average_crs.plot(figsize=(25,8))<jupyter_output><empty_output><jupyter_text>What day are people the happiest?<jupyter_code>data['Weekday'] = data['Timestamp'].dt.strftime('%A')
data['Daynumber'] = data['Timestamp'].dt.strftime('%w')


weekday_average = data.groupby(['Weekday', 'Daynumber']).mean()
weekday_average = weekday_average.sort_values('Daynumber')
weekday_average.index

plt.figure(figsize=[15, 3])
plt.plot(weekday_average.index.get_level_values(0), weekday_average['Rating'])<jupyter_output><empty_output><jupyter_text>Number of ratings by course<jupyter_code>share = data.groupby(['Course Name'])['Rating'].count()
share
plt.pie(share, labels=share.index)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1875, 'fraction_numerical': 0.009345794392523364, 'mean_word_length': 11.688888888888888, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '382021', 'license': 'MIT', 'n_tokens_mistral': 665, 'n_tokens_neox': 609, 'n_words': 71, 'path': 'review_analysis/new.ipynb', 'repo_name': 'yingzhuo1994/Data-Analysis-Visualization', 'size': '1712'}