def gen_threads_started(df):
    """
    Generate counts of threads started, by user and week.
    :param df: pd.DataFrame of forum post data.
    :return: pd.DataFrame of 'session_user_id', 'week', and threads_started.
    """
    df_starts = df[df.thread_order == 1].groupby(['session_user_id', 'week']).size().rename('threads_started').reset_index()
    return df_starts