{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Fact-Checking Facebook Politics Pages — Analysis\n", "\n", "See [this page](https://github.com/BuzzFeedNews/2016-10-facebook-fact-check) for context." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Prepare data" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "percentify = lambda x: (x * 100).round(1).astype(str) + \"%\"" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "posts = pd.read_csv(\"../data/facebook-fact-check.csv\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "2282" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(posts)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true }, "outputs": [], "source": [ "ENGAGEMENT_COLS = [\n", " \"share_count\",\n", " \"reaction_count\",\n", " \"comment_count\"\n", "]" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": true }, "outputs": [], "source": [ "RATINGS = [\"mostly false\", \"mixture of true and false\", \"mostly true\", \"no factual content\"]\n", "FACTUAL_RATINGS = [\"mostly false\", \"mixture of true and false\", \"mostly true\"]" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [], "source": [ "category_grp = posts.groupby(\"Category\")\n", "page_grp = posts.groupby([ \"Category\", \"Page\" ])\n", "type_grp = posts.groupby([ \"Category\", \"Page\", \"Post Type\" ])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Rating by category" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Counts:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Ratingmostly falsemixture of true and falsemostly trueno factual contenttotal
Category
left2268265116471
mainstream081085521145
right8316831996666
\n", "
" ], "text/plain": [ "Rating mostly false mixture of true and false mostly true \\\n", "Category \n", "left 22 68 265 \n", "mainstream 0 8 1085 \n", "right 83 168 319 \n", "\n", "Rating no factual content total \n", "Category \n", "left 116 471 \n", "mainstream 52 1145 \n", "right 96 666 " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rating_by_category = category_grp[\"Rating\"].value_counts().unstack()[RATINGS].fillna(0)\n", "rating_by_category[\"total\"] = rating_by_category.sum(axis=1)\n", "rating_by_category" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Percentages, of all posts:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
mostly falsemixture of true and falsemostly trueno factual content
Category
left4.7%14.4%56.3%24.6%
mainstream0.0%0.7%94.8%4.5%
right12.5%25.2%47.9%14.4%
\n", "
" ], "text/plain": [ " mostly false mixture of true and false mostly true \\\n", "Category \n", "left 4.7% 14.4% 56.3% \n", "mainstream 0.0% 0.7% 94.8% \n", "right 12.5% 25.2% 47.9% \n", "\n", " no factual content \n", "Category \n", "left 24.6% \n", "mainstream 4.5% \n", "right 14.4% " ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(rating_by_category[RATINGS].T / rating_by_category[RATINGS].sum(axis=1)).T\\\n", " .pipe(percentify)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Percentages, of posts not rated \"no factual content\":" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
mostly falsemixture of true and falsemostly true
Category
left6.2%19.2%74.6%
mainstream0.0%0.7%99.3%
right14.6%29.5%56.0%
\n", "
" ], "text/plain": [ " mostly false mixture of true and false mostly true\n", "Category \n", "left 6.2% 19.2% 74.6%\n", "mainstream 0.0% 0.7% 99.3%\n", "right 14.6% 29.5% 56.0%" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(rating_by_category[FACTUAL_RATINGS].T / rating_by_category[FACTUAL_RATINGS].sum(axis=1)).T\\\n", " .pipe(percentify)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Rating by page" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Counts:" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Ratingmostly falsemixture of true and falsemostly trueno factual contenttotal
CategoryPage
leftAddicting Info8259611140
Occupy Democrats93310265209
The Other 98%5106740122
mainstreamABC News Politics0217226200
CNN Politics0438520409
Politico025286536
rightEagle Rising305412181286
Freedom Daily2626564112
Right Wing News278814211268
\n", "
" ], "text/plain": [ "Rating mostly false mixture of true and false \\\n", "Category Page \n", "left Addicting Info 8 25 \n", " Occupy Democrats 9 33 \n", " The Other 98% 5 10 \n", "mainstream ABC News Politics 0 2 \n", " CNN Politics 0 4 \n", " Politico 0 2 \n", "right Eagle Rising 30 54 \n", " Freedom Daily 26 26 \n", " Right Wing News 27 88 \n", "\n", "Rating mostly true no factual content total \n", "Category Page \n", "left Addicting Info 96 11 140 \n", " Occupy Democrats 102 65 209 \n", " The Other 98% 67 40 122 \n", "mainstream ABC News Politics 172 26 200 \n", " CNN Politics 385 20 409 \n", " Politico 528 6 536 \n", "right Eagle Rising 121 81 286 \n", " Freedom Daily 56 4 112 \n", " Right Wing News 142 11 268 " ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rating_by_page = page_grp[\"Rating\"].value_counts().unstack()[RATINGS].fillna(0)\n", "rating_by_page[\"total\"] = rating_by_page.sum(axis=1)\n", "rating_by_page" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Percentages, of all posts:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
mostly falsemixture of true and falsemostly trueno factual content
CategoryPage
leftAddicting Info5.7%17.9%68.6%7.9%
Occupy Democrats4.3%15.8%48.8%31.1%
The Other 98%4.1%8.2%54.9%32.8%
mainstreamABC News Politics0.0%1.0%86.0%13.0%
CNN Politics0.0%1.0%94.1%4.9%
Politico0.0%0.4%98.5%1.1%
rightEagle Rising10.5%18.9%42.3%28.3%
Freedom Daily23.2%23.2%50.0%3.6%
Right Wing News10.1%32.8%53.0%4.1%
\n", "
" ], "text/plain": [ " mostly false mixture of true and false \\\n", "Category Page \n", "left Addicting Info 5.7% 17.9% \n", " Occupy Democrats 4.3% 15.8% \n", " The Other 98% 4.1% 8.2% \n", "mainstream ABC News Politics 0.0% 1.0% \n", " CNN Politics 0.0% 1.0% \n", " Politico 0.0% 0.4% \n", "right Eagle Rising 10.5% 18.9% \n", " Freedom Daily 23.2% 23.2% \n", " Right Wing News 10.1% 32.8% \n", "\n", " mostly true no factual content \n", "Category Page \n", "left Addicting Info 68.6% 7.9% \n", " Occupy Democrats 48.8% 31.1% \n", " The Other 98% 54.9% 32.8% \n", "mainstream ABC News Politics 86.0% 13.0% \n", " CNN Politics 94.1% 4.9% \n", " Politico 98.5% 1.1% \n", "right Eagle Rising 42.3% 28.3% \n", " Freedom Daily 50.0% 3.6% \n", " Right Wing News 53.0% 4.1% " ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(rating_by_page[RATINGS].T / rating_by_page[RATINGS].sum(axis=1)).T\\\n", " .pipe(percentify)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Percentages, of posts not rated \"no factual content\":" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
mostly falsemixture of true and falsemostly true
CategoryPage
leftAddicting Info6.2%19.4%74.4%
Occupy Democrats6.2%22.9%70.8%
The Other 98%6.1%12.2%81.7%
mainstreamABC News Politics0.0%1.1%98.9%
CNN Politics0.0%1.0%99.0%
Politico0.0%0.4%99.6%
rightEagle Rising14.6%26.3%59.0%
Freedom Daily24.1%24.1%51.9%
Right Wing News10.5%34.2%55.3%
\n", "
" ], "text/plain": [ " mostly false mixture of true and false \\\n", "Category Page \n", "left Addicting Info 6.2% 19.4% \n", " Occupy Democrats 6.2% 22.9% \n", " The Other 98% 6.1% 12.2% \n", "mainstream ABC News Politics 0.0% 1.1% \n", " CNN Politics 0.0% 1.0% \n", " Politico 0.0% 0.4% \n", "right Eagle Rising 14.6% 26.3% \n", " Freedom Daily 24.1% 24.1% \n", " Right Wing News 10.5% 34.2% \n", "\n", " mostly true \n", "Category Page \n", "left Addicting Info 74.4% \n", " Occupy Democrats 70.8% \n", " The Other 98% 81.7% \n", "mainstream ABC News Politics 98.9% \n", " CNN Politics 99.0% \n", " Politico 99.6% \n", "right Eagle Rising 59.0% \n", " Freedom Daily 51.9% \n", " Right Wing News 55.3% " ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(rating_by_page[FACTUAL_RATINGS].T / rating_by_page[FACTUAL_RATINGS].sum(axis=1)).T\\\n", " .pipe(percentify)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Number of posts by date" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Counts:" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Date Published2016-09-192016-09-202016-09-212016-09-222016-09-232016-09-262016-09-27Avg. Per Day
Category
left5570585466808867
mainstream154156151146135223180164
right97919793931009595
\n", "
" ], "text/plain": [ "Date Published 2016-09-19 2016-09-20 2016-09-21 2016-09-22 2016-09-23 \\\n", "Category \n", "left 55 70 58 54 66 \n", "mainstream 154 156 151 146 135 \n", "right 97 91 97 93 93 \n", "\n", "Date Published 2016-09-26 2016-09-27 Avg. Per Day \n", "Category \n", "left 80 88 67 \n", "mainstream 223 180 164 \n", "right 100 95 95 " ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "posts_by_date_by_category = category_grp[\"Date Published\"].value_counts().unstack()\n", "posts_by_date_by_category[\"Avg. Per Day\"] = posts_by_date_by_category.mean(axis=1).round(0)\n", "posts_by_date_by_category" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Date Published2016-09-192016-09-202016-09-212016-09-222016-09-232016-09-262016-09-27Avg. Per Day
CategoryPage
leftAddicting Info2218172122172320
Occupy Democrats2030201929474430
The Other 98%1322211415162117
mainstreamABC News Politics3622232122472929
CNN Politics5461536248666558
Politico64737563651108677
rightEagle Rising4141424141413941
Freedom Daily1916171515151516
Right Wing News3734383737444138
\n", "
" ], "text/plain": [ "Date Published 2016-09-19 2016-09-20 2016-09-21 2016-09-22 \\\n", "Category Page \n", "left Addicting Info 22 18 17 21 \n", " Occupy Democrats 20 30 20 19 \n", " The Other 98% 13 22 21 14 \n", "mainstream ABC News Politics 36 22 23 21 \n", " CNN Politics 54 61 53 62 \n", " Politico 64 73 75 63 \n", "right Eagle Rising 41 41 42 41 \n", " Freedom Daily 19 16 17 15 \n", " Right Wing News 37 34 38 37 \n", "\n", "Date Published 2016-09-23 2016-09-26 2016-09-27 Avg. Per Day \n", "Category Page \n", "left Addicting Info 22 17 23 20 \n", " Occupy Democrats 29 47 44 30 \n", " The Other 98% 15 16 21 17 \n", "mainstream ABC News Politics 22 47 29 29 \n", " CNN Politics 48 66 65 58 \n", " Politico 65 110 86 77 \n", "right Eagle Rising 41 41 39 41 \n", " Freedom Daily 15 15 15 16 \n", " Right Wing News 37 44 41 38 " ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "posts_by_date_by_page = page_grp[\"Date Published\"].value_counts().unstack()\n", "posts_by_date_by_page[\"Avg. Per Day\"] = posts_by_date_by_page.mean(axis=1).round(0)\n", "posts_by_date_by_page" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Rating by post type" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Ratingmostly falsemixture of true and falsemostly trueno factual contenttotal
CategoryPagePost Type
leftAddicting Infolink825947134
photo00134
video00112
Occupy Democratslink72660194
photo22254978
video05171537
The Other 98%link1740351
photo40112641
video03161130
mainstreamABC News Politicslink021042108
photo0013013
text00101
video00542478
CNN Politicslink0431610330
photo00358
text00101
video0065570
Politicolink024583463
photo00527
text00101
video0064165
rightEagle Risinglink275011737231
photo3333746
video01179
Freedom Dailylink2625564111
text01001
Right Wing Newslink27871404258
photo012710
\n", "
" ], "text/plain": [ "Rating mostly false \\\n", "Category Page Post Type \n", "left Addicting Info link 8 \n", " photo 0 \n", " video 0 \n", " Occupy Democrats link 7 \n", " photo 2 \n", " video 0 \n", " The Other 98% link 1 \n", " photo 4 \n", " video 0 \n", "mainstream ABC News Politics link 0 \n", " photo 0 \n", " text 0 \n", " video 0 \n", " CNN Politics link 0 \n", " photo 0 \n", " text 0 \n", " video 0 \n", " Politico link 0 \n", " photo 0 \n", " text 0 \n", " video 0 \n", "right Eagle Rising link 27 \n", " photo 3 \n", " video 0 \n", " Freedom Daily link 26 \n", " text 0 \n", " Right Wing News link 27 \n", " photo 0 \n", "\n", "Rating mixture of true and false \\\n", "Category Page Post Type \n", "left Addicting Info link 25 \n", " photo 0 \n", " video 0 \n", " Occupy Democrats link 26 \n", " photo 2 \n", " video 5 \n", " The Other 98% link 7 \n", " photo 0 \n", " video 3 \n", "mainstream ABC News Politics link 2 \n", " photo 0 \n", " text 0 \n", " video 0 \n", " CNN Politics link 4 \n", " photo 0 \n", " text 0 \n", " video 0 \n", " Politico link 2 \n", " photo 0 \n", " text 0 \n", " video 0 \n", "right Eagle Rising link 50 \n", " photo 3 \n", " video 1 \n", " Freedom Daily link 25 \n", " text 1 \n", " Right Wing News link 87 \n", " photo 1 \n", "\n", "Rating mostly true no factual content total \n", "Category Page Post Type \n", "left Addicting Info link 94 7 134 \n", " photo 1 3 4 \n", " video 1 1 2 \n", " Occupy Democrats link 60 1 94 \n", " photo 25 49 78 \n", " video 17 15 37 \n", " The Other 98% link 40 3 51 \n", " photo 11 26 41 \n", " video 16 11 30 \n", "mainstream ABC News Politics link 104 2 108 \n", " photo 13 0 13 \n", " text 1 0 1 \n", " video 54 24 78 \n", " CNN Politics link 316 10 330 \n", " photo 3 5 8 \n", " text 1 0 1 \n", " video 65 5 70 \n", " Politico link 458 3 463 \n", " photo 5 2 7 \n", " text 1 0 1 \n", " video 64 1 65 \n", "right Eagle Rising link 117 37 231 \n", " photo 3 37 46 \n", " video 1 7 9 \n", " Freedom Daily link 56 4 111 \n", " text 0 0 1 \n", " Right Wing News link 140 4 258 \n", " photo 2 7 10 " ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rating_by_post_type = type_grp[\"Rating\"].value_counts().unstack()[RATINGS].fillna(0)\n", "rating_by_post_type[\"total\"] = rating_by_post_type.sum(axis=1)\n", "rating_by_post_type" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Engagement" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Count of missing engagement figures:" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "share_count 70\n", "reaction_count 2\n", "comment_count 2\n", "dtype: int64" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "posts[ENGAGEMENT_COLS].isnull().sum()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Median engagement by page" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
share_countreaction_countcomment_count
CategoryPage
leftAddicting Info5632230271
Occupy Democrats10931223601205
The Other 98%394212083521
mainstreamABC News Politics138028
CNN Politics50340194
Politico3331495
rightEagle Rising9218622
Freedom Daily9472245214
Right Wing News26691391
\n", "
" ], "text/plain": [ " share_count reaction_count comment_count\n", "Category Page \n", "left Addicting Info 563 2230 271\n", " Occupy Democrats 10931 22360 1205\n", " The Other 98% 3942 12083 521\n", "mainstream ABC News Politics 13 80 28\n", " CNN Politics 50 340 194\n", " Politico 33 314 95\n", "right Eagle Rising 92 186 22\n", " Freedom Daily 947 2245 214\n", " Right Wing News 266 913 91" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "page_grp[ENGAGEMENT_COLS].median().round()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Average engagement by page" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
share_countreaction_countcomment_count
CategoryPage
leftAddicting Info12703120392
Occupy Democrats29205346692858
The Other 98%1800720971915
mainstreamABC News Politics4417771
CNN Politics183678322
Politico182900170
rightEagle Rising61652079
Freedom Daily24743685516
Right Wing News13982454360
\n", "
" ], "text/plain": [ " share_count reaction_count comment_count\n", "Category Page \n", "left Addicting Info 1270 3120 392\n", " Occupy Democrats 29205 34669 2858\n", " The Other 98% 18007 20971 915\n", "mainstream ABC News Politics 44 177 71\n", " CNN Politics 183 678 322\n", " Politico 182 900 170\n", "right Eagle Rising 616 520 79\n", " Freedom Daily 2474 3685 516\n", " Right Wing News 1398 2454 360" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "page_grp[ENGAGEMENT_COLS].mean().round()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Engagement by truthfulness" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "collapsed": false }, "outputs": [], "source": [ "grp = posts.groupby([ \"Category\", \"Page\", \"Rating\" ])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Counts:" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Ratingmixture of true and falsemostly falsemostly trueno factual content
CategoryPage
leftAddicting Info2589611
Occupy Democrats33910265
The Other 98%1056740
mainstreamABC News Politics2017226
CNN Politics4038520
Politico205286
rightEagle Rising543012181
Freedom Daily2626564
Right Wing News882714211
\n", "
" ], "text/plain": [ "Rating mixture of true and false mostly false \\\n", "Category Page \n", "left Addicting Info 25 8 \n", " Occupy Democrats 33 9 \n", " The Other 98% 10 5 \n", "mainstream ABC News Politics 2 0 \n", " CNN Politics 4 0 \n", " Politico 2 0 \n", "right Eagle Rising 54 30 \n", " Freedom Daily 26 26 \n", " Right Wing News 88 27 \n", "\n", "Rating mostly true no factual content \n", "Category Page \n", "left Addicting Info 96 11 \n", " Occupy Democrats 102 65 \n", " The Other 98% 67 40 \n", "mainstream ABC News Politics 172 26 \n", " CNN Politics 385 20 \n", " Politico 528 6 \n", "right Eagle Rising 121 81 \n", " Freedom Daily 56 4 \n", " Right Wing News 142 11 " ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grp[ENGAGEMENT_COLS].size().unstack().fillna(0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Medians:" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
share_countreaction_countcomment_count
CategoryPageRating
leftAddicting Infomixture of true and false11323087402
mostly false2851910394
mostly true5231966235
no factual content3992351153
Occupy Democratsmixture of true and false10654170851461
mostly false554117525638
mostly true7755159511090
no factual content18345373261396
The Other 98%mixture of true and false47499040742
mostly false1157119682930
mostly true28967082372
no factual content1033725951638
mainstreamABC News Politicsmixture of true and false7647959
mostly true127828
no factual content387823
CNN Politicsmixture of true and false2701374315
mostly true48343194
no factual content64245184
Politicomixture of true and false7325203441510
mostly true3331096
no factual content4830948
rightEagle Risingmixture of true and false11022232
mostly false53455155
mostly true4611117
no factual content25030017
Freedom Dailymixture of true and false342922140
mostly false16232455276
mostly true9082476191
no factual content20254264262
Right Wing Newsmixture of true and false4291270132
mostly false7811430192
mostly true9140050
no factual content49338539201
\n", "
" ], "text/plain": [ " share_count \\\n", "Category Page Rating \n", "left Addicting Info mixture of true and false 1132 \n", " mostly false 285 \n", " mostly true 523 \n", " no factual content 399 \n", " Occupy Democrats mixture of true and false 10654 \n", " mostly false 5541 \n", " mostly true 7755 \n", " no factual content 18345 \n", " The Other 98% mixture of true and false 4749 \n", " mostly false 11571 \n", " mostly true 2896 \n", " no factual content 10337 \n", "mainstream ABC News Politics mixture of true and false 76 \n", " mostly true 12 \n", " no factual content 38 \n", " CNN Politics mixture of true and false 270 \n", " mostly true 48 \n", " no factual content 64 \n", " Politico mixture of true and false 7325 \n", " mostly true 33 \n", " no factual content 48 \n", "right Eagle Rising mixture of true and false 110 \n", " mostly false 534 \n", " mostly true 46 \n", " no factual content 250 \n", " Freedom Daily mixture of true and false 342 \n", " mostly false 1623 \n", " mostly true 908 \n", " no factual content 2025 \n", " Right Wing News mixture of true and false 429 \n", " mostly false 781 \n", " mostly true 91 \n", " no factual content 4933 \n", "\n", " reaction_count \\\n", "Category Page Rating \n", "left Addicting Info mixture of true and false 3087 \n", " mostly false 1910 \n", " mostly true 1966 \n", " no factual content 2351 \n", " Occupy Democrats mixture of true and false 17085 \n", " mostly false 17525 \n", " mostly true 15951 \n", " no factual content 37326 \n", " The Other 98% mixture of true and false 9040 \n", " mostly false 19682 \n", " mostly true 7082 \n", " no factual content 25951 \n", "mainstream ABC News Politics mixture of true and false 479 \n", " mostly true 78 \n", " no factual content 78 \n", " CNN Politics mixture of true and false 1374 \n", " mostly true 343 \n", " no factual content 245 \n", " Politico mixture of true and false 20344 \n", " mostly true 310 \n", " no factual content 309 \n", "right Eagle Rising mixture of true and false 222 \n", " mostly false 551 \n", " mostly true 111 \n", " no factual content 300 \n", " Freedom Daily mixture of true and false 922 \n", " mostly false 2455 \n", " mostly true 2476 \n", " no factual content 4264 \n", " Right Wing News mixture of true and false 1270 \n", " mostly false 1430 \n", " mostly true 400 \n", " no factual content 8539 \n", "\n", " comment_count \n", "Category Page Rating \n", "left Addicting Info mixture of true and false 402 \n", " mostly false 394 \n", " mostly true 235 \n", " no factual content 153 \n", " Occupy Democrats mixture of true and false 1461 \n", " mostly false 638 \n", " mostly true 1090 \n", " no factual content 1396 \n", " The Other 98% mixture of true and false 742 \n", " mostly false 930 \n", " mostly true 372 \n", " no factual content 638 \n", "mainstream ABC News Politics mixture of true and false 59 \n", " mostly true 28 \n", " no factual content 23 \n", " CNN Politics mixture of true and false 315 \n", " mostly true 194 \n", " no factual content 184 \n", " Politico mixture of true and false 1510 \n", " mostly true 96 \n", " no factual content 48 \n", "right Eagle Rising mixture of true and false 32 \n", " mostly false 55 \n", " mostly true 17 \n", " no factual content 17 \n", " Freedom Daily mixture of true and false 140 \n", " mostly false 276 \n", " mostly true 191 \n", " no factual content 262 \n", " Right Wing News mixture of true and false 132 \n", " mostly false 192 \n", " mostly true 50 \n", " no factual content 201 " ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grp[ENGAGEMENT_COLS].median().round()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Averages:" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
share_countreaction_countcomment_count
CategoryPageRating
leftAddicting Infomixture of true and false15163451460
mostly false18914004704
mostly true10052800368
no factual content27664520227
Occupy Democratsmixture of true and false26036289332924
mostly false10603228541426
mostly true16215250001624
no factual content55171543884959
The Other 98%mixture of true and false954411270942
mostly false13738245571051
mostly true1076514053793
no factual content32588343631092
mainstreamABC News Politicsmixture of true and false7647959
mostly true4217667
no factual content63159103
CNN Politicsmixture of true and false2391327262
mostly true181672321
no factual content215656346
Politicomixture of true and false7325203441510
mostly true156832166
no factual content8342054
rightEagle Risingmixture of true and false1182707149
mostly false130092689
mostly true26330067
no factual content50657349
Freedom Dailymixture of true and false13772489553
mostly false33904651576
mostly true25433692480
no factual content27125089390
Right Wing Newsmixture of true and false14822485452
mostly false23663879421
mostly true6681602291
no factual content77139705360
\n", "
" ], "text/plain": [ " share_count \\\n", "Category Page Rating \n", "left Addicting Info mixture of true and false 1516 \n", " mostly false 1891 \n", " mostly true 1005 \n", " no factual content 2766 \n", " Occupy Democrats mixture of true and false 26036 \n", " mostly false 10603 \n", " mostly true 16215 \n", " no factual content 55171 \n", " The Other 98% mixture of true and false 9544 \n", " mostly false 13738 \n", " mostly true 10765 \n", " no factual content 32588 \n", "mainstream ABC News Politics mixture of true and false 76 \n", " mostly true 42 \n", " no factual content 63 \n", " CNN Politics mixture of true and false 239 \n", " mostly true 181 \n", " no factual content 215 \n", " Politico mixture of true and false 7325 \n", " mostly true 156 \n", " no factual content 83 \n", "right Eagle Rising mixture of true and false 1182 \n", " mostly false 1300 \n", " mostly true 263 \n", " no factual content 506 \n", " Freedom Daily mixture of true and false 1377 \n", " mostly false 3390 \n", " mostly true 2543 \n", " no factual content 2712 \n", " Right Wing News mixture of true and false 1482 \n", " mostly false 2366 \n", " mostly true 668 \n", " no factual content 7713 \n", "\n", " reaction_count \\\n", "Category Page Rating \n", "left Addicting Info mixture of true and false 3451 \n", " mostly false 4004 \n", " mostly true 2800 \n", " no factual content 4520 \n", " Occupy Democrats mixture of true and false 28933 \n", " mostly false 22854 \n", " mostly true 25000 \n", " no factual content 54388 \n", " The Other 98% mixture of true and false 11270 \n", " mostly false 24557 \n", " mostly true 14053 \n", " no factual content 34363 \n", "mainstream ABC News Politics mixture of true and false 479 \n", " mostly true 176 \n", " no factual content 159 \n", " CNN Politics mixture of true and false 1327 \n", " mostly true 672 \n", " no factual content 656 \n", " Politico mixture of true and false 20344 \n", " mostly true 832 \n", " no factual content 420 \n", "right Eagle Rising mixture of true and false 707 \n", " mostly false 926 \n", " mostly true 300 \n", " no factual content 573 \n", " Freedom Daily mixture of true and false 2489 \n", " mostly false 4651 \n", " mostly true 3692 \n", " no factual content 5089 \n", " Right Wing News mixture of true and false 2485 \n", " mostly false 3879 \n", " mostly true 1602 \n", " no factual content 9705 \n", "\n", " comment_count \n", "Category Page Rating \n", "left Addicting Info mixture of true and false 460 \n", " mostly false 704 \n", " mostly true 368 \n", " no factual content 227 \n", " Occupy Democrats mixture of true and false 2924 \n", " mostly false 1426 \n", " mostly true 1624 \n", " no factual content 4959 \n", " The Other 98% mixture of true and false 942 \n", " mostly false 1051 \n", " mostly true 793 \n", " no factual content 1092 \n", "mainstream ABC News Politics mixture of true and false 59 \n", " mostly true 67 \n", " no factual content 103 \n", " CNN Politics mixture of true and false 262 \n", " mostly true 321 \n", " no factual content 346 \n", " Politico mixture of true and false 1510 \n", " mostly true 166 \n", " no factual content 54 \n", "right Eagle Rising mixture of true and false 149 \n", " mostly false 89 \n", " mostly true 67 \n", " no factual content 49 \n", " Freedom Daily mixture of true and false 553 \n", " mostly false 576 \n", " mostly true 480 \n", " no factual content 390 \n", " Right Wing News mixture of true and false 452 \n", " mostly false 421 \n", " mostly true 291 \n", " no factual content 360 " ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grp[ENGAGEMENT_COLS].mean().round()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Engagement by post type" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Medians:" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
share_countreaction_countcomment_count
CategoryPagePost Type
leftAddicting Infolink5632195262
photo35325814534
video2751302117
Occupy Democratslink5130108621020
photo18294347301290
video26648300112287
The Other 98%link33918836529
photo1244126990604
video15984751364
mainstreamABC News Politicslink96827
photo63014
text252
video3713832
CNN Politicslink36284177
photo5111888
text495103
video125691456
Politicolink3229092
photo86227
text25826
video48428132
rightEagle Risinglink7015420
photo56975024
video387314
Freedom Dailylink9642263224
text3477
Right Wing Newslink24682487
photo847412115180
\n", "
" ], "text/plain": [ " share_count reaction_count \\\n", "Category Page Post Type \n", "left Addicting Info link 563 2195 \n", " photo 3532 5814 \n", " video 275 1302 \n", " Occupy Democrats link 5130 10862 \n", " photo 18294 34730 \n", " video 26648 30011 \n", " The Other 98% link 3391 8836 \n", " photo 12441 26990 \n", " video 1598 4751 \n", "mainstream ABC News Politics link 9 68 \n", " photo 6 30 \n", " text 2 5 \n", " video 37 138 \n", " CNN Politics link 36 284 \n", " photo 51 118 \n", " text 4 95 \n", " video 125 691 \n", " Politico link 32 290 \n", " photo 8 62 \n", " text 2 58 \n", " video 48 428 \n", "right Eagle Rising link 70 154 \n", " photo 569 750 \n", " video 38 73 \n", " Freedom Daily link 964 2263 \n", " text 3 47 \n", " Right Wing News link 246 824 \n", " photo 8474 12115 \n", "\n", " comment_count \n", "Category Page Post Type \n", "left Addicting Info link 262 \n", " photo 534 \n", " video 117 \n", " Occupy Democrats link 1020 \n", " photo 1290 \n", " video 2287 \n", " The Other 98% link 529 \n", " photo 604 \n", " video 364 \n", "mainstream ABC News Politics link 27 \n", " photo 14 \n", " text 2 \n", " video 32 \n", " CNN Politics link 177 \n", " photo 88 \n", " text 103 \n", " video 456 \n", " Politico link 92 \n", " photo 27 \n", " text 26 \n", " video 132 \n", "right Eagle Rising link 20 \n", " photo 24 \n", " video 14 \n", " Freedom Daily link 224 \n", " text 7 \n", " Right Wing News link 87 \n", " photo 180 " ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type_grp[ENGAGEMENT_COLS].median().round()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Averages:" ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
share_countreaction_countcomment_count
CategoryPagePost Type
leftAddicting Infolink11683028391
photo60217128578
video2751302117
Occupy Democratslink7463160941272
photo25268437351604
video97767627469531
The Other 98%link1034113847882
photo2887538285924
video167129021959
mainstreamABC News Politicslink2312440
photo95121
text252
video90273125
CNN Politicslink176604256
photo77212112
text495103
video2371088663
Politicolink181879168
photo7729931
text25826
video2011132203
rightEagle Risinglink45441181
photo1461115180
video389431
Freedom Dailylink24973718521
text3477
Right Wing Newslink9992048358
photo1166412928408
\n", "
" ], "text/plain": [ " share_count reaction_count \\\n", "Category Page Post Type \n", "left Addicting Info link 1168 3028 \n", " photo 6021 7128 \n", " video 275 1302 \n", " Occupy Democrats link 7463 16094 \n", " photo 25268 43735 \n", " video 97767 62746 \n", " The Other 98% link 10341 13847 \n", " photo 28875 38285 \n", " video 16712 9021 \n", "mainstream ABC News Politics link 23 124 \n", " photo 9 51 \n", " text 2 5 \n", " video 90 273 \n", " CNN Politics link 176 604 \n", " photo 77 212 \n", " text 4 95 \n", " video 237 1088 \n", " Politico link 181 879 \n", " photo 77 299 \n", " text 2 58 \n", " video 201 1132 \n", "right Eagle Rising link 454 411 \n", " photo 1461 1151 \n", " video 38 94 \n", " Freedom Daily link 2497 3718 \n", " text 3 47 \n", " Right Wing News link 999 2048 \n", " photo 11664 12928 \n", "\n", " comment_count \n", "Category Page Post Type \n", "left Addicting Info link 391 \n", " photo 578 \n", " video 117 \n", " Occupy Democrats link 1272 \n", " photo 1604 \n", " video 9531 \n", " The Other 98% link 882 \n", " photo 924 \n", " video 959 \n", "mainstream ABC News Politics link 40 \n", " photo 21 \n", " text 2 \n", " video 125 \n", " CNN Politics link 256 \n", " photo 112 \n", " text 103 \n", " video 663 \n", " Politico link 168 \n", " photo 31 \n", " text 26 \n", " video 203 \n", "right Eagle Rising link 81 \n", " photo 80 \n", " video 31 \n", " Freedom Daily link 521 \n", " text 7 \n", " Right Wing News link 358 \n", " photo 408 " ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type_grp[ENGAGEMENT_COLS].mean().round()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Shares by factual vs. no factual content" ] }, { "cell_type": "code", "execution_count": 26, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Ratingfactual contentno factual content
CategoryPage
leftAddicting Infoaverage11502766
median578399
Occupy Democratsaverage1815555171
median799718345
The Other 98%average1082032588
median348410337
mainstreamABC News Politicsaverage4363
median1338
CNN Politicsaverage182215
median4864
Politicoaverage18383
median3348
rightEagle Risingaverage656506
median75250
Freedom Dailyaverage24662712
median9472025
Right Wing Newsaverage11277713
median2464933
\n", "
" ], "text/plain": [ "Rating factual content no factual content\n", "Category Page \n", "left Addicting Info average 1150 2766\n", " median 578 399\n", " Occupy Democrats average 18155 55171\n", " median 7997 18345\n", " The Other 98% average 10820 32588\n", " median 3484 10337\n", "mainstream ABC News Politics average 43 63\n", " median 13 38\n", " CNN Politics average 182 215\n", " median 48 64\n", " Politico average 183 83\n", " median 33 48\n", "right Eagle Rising average 656 506\n", " median 75 250\n", " Freedom Daily average 2466 2712\n", " median 947 2025\n", " Right Wing News average 1127 7713\n", " median 246 4933" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grp = posts.groupby([ \"Category\", \"Page\", posts[\"Rating\"] == \"no factual content\" ])\n", "pd.DataFrame({\n", " \"median\": grp[\"share_count\"].median(),\n", " \"average\": grp[\"share_count\"].mean()\n", "}).round()\\\n", " .unstack().stack(level=0).rename(columns={True: \"no factual content\", False: \"factual content\"})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Shares for mostly-true vs. others for partisan pages" ] }, { "cell_type": "code", "execution_count": 27, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Ratingmostly trueeverything else
CategoryPage
leftAddicting Infoaverage10051894
median523882
Occupy Democratsaverage1621541812
median775513330
The Other 98%average1076526432
median28968236
rightEagle Risingaverage263886
median46201
Freedom Dailyaverage25432407
median9081142
Right Wing Newsaverage6682215
median91568
\n", "
" ], "text/plain": [ "Rating mostly true everything else\n", "Category Page \n", "left Addicting Info average 1005 1894\n", " median 523 882\n", " Occupy Democrats average 16215 41812\n", " median 7755 13330\n", " The Other 98% average 10765 26432\n", " median 2896 8236\n", "right Eagle Rising average 263 886\n", " median 46 201\n", " Freedom Daily average 2543 2407\n", " median 908 1142\n", " Right Wing News average 668 2215\n", " median 91 568" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grp = posts.groupby([ \"Category\", \"Page\", posts[\"Rating\"] == \"mostly true\" ])\n", "pd.DataFrame({\n", " \"median\": grp[\"share_count\"].median(),\n", " \"average\": grp[\"share_count\"].mean()\n", "}).round()\\\n", " .unstack().stack(level=0).rename(columns={True: \"mostly true\", False: \"everything else\"})\\\n", " [[ \"mostly true\", \"everything else\" ]].loc[[\"left\", \"right\"]]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "\n", "---\n", "\n", "---" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.4.3" } }, "nbformat": 4, "nbformat_minor": 0 }