<jupyter_start><jupyter_text>Question 95 - User messagingData Analysis Python Pandas Data ManipulationBelow is a table schema for a new messaging app. The table contains send/receive message data for the application's users.```table name: user_messaging     time_stamp (integer)              timestamp, epoch seconds     sender_id (integer)               id of the message sender     receiver_id (integer)             id of the message receiver```Question: What fraction of active users communicate with at least 25 unique people on April 2nd, 2018?<jupyter_code>import pandas as pd

df = pd.DataFrame({
    'ts':[1522640760, 1522638060, 1522627260, 1522670460, 1522671460], 
    'sender_id':[123,456,123,123,123],
    'receiver_id':[456,123,789,234,345]
})


# for each sender, count number of distinct ppl contacted
contacted = df.groupby('sender_id').agg({'receiver_id':pd.Series.nunique})

# proportion of sending users sending a message to at least 3 people: 1/2
sum(contacted['receiver_id']>=3) / len(contacted)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09455587392550144, 'fraction_numerical': 0.08882521489971347, 'mean_word_length': 4.544973544973545, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '399562', 'license': 'Unlicense', 'n_tokens_mistral': 384, 'n_tokens_neox': 309, 'n_words': 103, 'path': 'interviewq_exercises/q095_pandas_proportion_users_sending_messages.ipynb', 'repo_name': 'gentimouton/dives', 'size': '1047'}