<jupyter_start><jupyter_text>Some queries on the Philly Data Science dataset<jupyter_code>!pip install seaborn # seaborn is not in a default anaconda installation
%matplotlib inline
import seaborn as sns
import pandas as pd
from matplotlib import rcParams

# Modify aesthetics for visibility during presentation
sns.set_style('darkgrid', {'axes.facecolor': '#C2C2C8'})
sns.set_palette('colorblind')

# Make everything bigger for visibility during presentation
rcParams['figure.figsize'] = 20, 10
rcParams['axes.titlesize'] = 'xx-large'
rcParams['axes.labelsize'] = 'x-large'
rcParams['xtick.labelsize'] = 'x-large'
rcParams['ytick.labelsize'] = 'x-large'
rcParams['legend.fontsize'] = 'xx-large'
rcParams['lines.linewidth'] = 4.0
rcParams['grid.linewidth'] = 2.0

# Hide warnings in the notebook
import warnings
warnings.filterwarnings('ignore')<jupyter_output><empty_output><jupyter_text>DataPhilly events dataset: graph the ratings<jupyter_code>events_df = pd.read_pickle('events.pkl')
events_df = events_df.sort_values(by='time')
events_df
events_df.head()
events_df.tail(3)<jupyter_output><empty_output><jupyter_text>Let's clean up the rating column. And look at some basic statistics of the result:<jupyter_code>events_df['rating_average'] = events_df['rating'].apply(lambda entry: entry['average'])
events_df['rating_average']
events_df['rating_count'] = events_df['rating'].apply(lambda entry: entry['count'])
events_df['rating_count']
rating_count = events_df['rating_count']
rating_average = events_df['rating_average']
rating_count.describe()
rating_average.describe()<jupyter_output><empty_output><jupyter_text>Let's plot these with the attendance counts to explore if there is a relation.<jupyter_code>import datetime
def get_datetime_from_epoch(epoch):
    return datetime.datetime.fromtimestamp(epoch/1000.0)
events_df['time'] = events_df['time'].apply(get_datetime_from_epoch)
events_df['time']<jupyter_output><empty_output><jupyter_text>Next let's make the ``time`` column the index of the ``DataFrame`` using the ``set_index`` method and then re-``plot`` our data.<jupyter_code>events_df.set_index('time', inplace=True)
events_df['rating_count'].plot()
all_rsvps = events_df[['yes_rsvp_count', 'waitlist_count', 'rating_count', 'rating_average']]
all_rsvps.plot(title='Ratings and Attendance over time')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12893617021276596, 'fraction_numerical': 0.00723404255319149, 'mean_word_length': 9.090128755364807, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '308916', 'license': 'MIT', 'n_tokens_mistral': 802, 'n_tokens_neox': 774, 'n_words': 166, 'path': 'DataPhilly_Analysis-Tests.ipynb', 'repo_name': 'starlight7719/daa_philly_2015', 'size': '2350'}