{
"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",
" Rating | \n",
" mostly false | \n",
" mixture of true and false | \n",
" mostly true | \n",
" no factual content | \n",
" total | \n",
"
\n",
" \n",
" Category | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" 22 | \n",
" 68 | \n",
" 265 | \n",
" 116 | \n",
" 471 | \n",
"
\n",
" \n",
" mainstream | \n",
" 0 | \n",
" 8 | \n",
" 1085 | \n",
" 52 | \n",
" 1145 | \n",
"
\n",
" \n",
" right | \n",
" 83 | \n",
" 168 | \n",
" 319 | \n",
" 96 | \n",
" 666 | \n",
"
\n",
" \n",
"
\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",
" mostly false | \n",
" mixture of true and false | \n",
" mostly true | \n",
" no factual content | \n",
"
\n",
" \n",
" Category | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" 4.7% | \n",
" 14.4% | \n",
" 56.3% | \n",
" 24.6% | \n",
"
\n",
" \n",
" mainstream | \n",
" 0.0% | \n",
" 0.7% | \n",
" 94.8% | \n",
" 4.5% | \n",
"
\n",
" \n",
" right | \n",
" 12.5% | \n",
" 25.2% | \n",
" 47.9% | \n",
" 14.4% | \n",
"
\n",
" \n",
"
\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",
" mostly false | \n",
" mixture of true and false | \n",
" mostly true | \n",
"
\n",
" \n",
" Category | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" 6.2% | \n",
" 19.2% | \n",
" 74.6% | \n",
"
\n",
" \n",
" mainstream | \n",
" 0.0% | \n",
" 0.7% | \n",
" 99.3% | \n",
"
\n",
" \n",
" right | \n",
" 14.6% | \n",
" 29.5% | \n",
" 56.0% | \n",
"
\n",
" \n",
"
\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",
" Rating | \n",
" mostly false | \n",
" mixture of true and false | \n",
" mostly true | \n",
" no factual content | \n",
" total | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" 8 | \n",
" 25 | \n",
" 96 | \n",
" 11 | \n",
" 140 | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" 9 | \n",
" 33 | \n",
" 102 | \n",
" 65 | \n",
" 209 | \n",
"
\n",
" \n",
" The Other 98% | \n",
" 5 | \n",
" 10 | \n",
" 67 | \n",
" 40 | \n",
" 122 | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" 0 | \n",
" 2 | \n",
" 172 | \n",
" 26 | \n",
" 200 | \n",
"
\n",
" \n",
" CNN Politics | \n",
" 0 | \n",
" 4 | \n",
" 385 | \n",
" 20 | \n",
" 409 | \n",
"
\n",
" \n",
" Politico | \n",
" 0 | \n",
" 2 | \n",
" 528 | \n",
" 6 | \n",
" 536 | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" 30 | \n",
" 54 | \n",
" 121 | \n",
" 81 | \n",
" 286 | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" 26 | \n",
" 26 | \n",
" 56 | \n",
" 4 | \n",
" 112 | \n",
"
\n",
" \n",
" Right Wing News | \n",
" 27 | \n",
" 88 | \n",
" 142 | \n",
" 11 | \n",
" 268 | \n",
"
\n",
" \n",
"
\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",
" mostly false | \n",
" mixture of true and false | \n",
" mostly true | \n",
" no factual content | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" 5.7% | \n",
" 17.9% | \n",
" 68.6% | \n",
" 7.9% | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" 4.3% | \n",
" 15.8% | \n",
" 48.8% | \n",
" 31.1% | \n",
"
\n",
" \n",
" The Other 98% | \n",
" 4.1% | \n",
" 8.2% | \n",
" 54.9% | \n",
" 32.8% | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" 0.0% | \n",
" 1.0% | \n",
" 86.0% | \n",
" 13.0% | \n",
"
\n",
" \n",
" CNN Politics | \n",
" 0.0% | \n",
" 1.0% | \n",
" 94.1% | \n",
" 4.9% | \n",
"
\n",
" \n",
" Politico | \n",
" 0.0% | \n",
" 0.4% | \n",
" 98.5% | \n",
" 1.1% | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" 10.5% | \n",
" 18.9% | \n",
" 42.3% | \n",
" 28.3% | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" 23.2% | \n",
" 23.2% | \n",
" 50.0% | \n",
" 3.6% | \n",
"
\n",
" \n",
" Right Wing News | \n",
" 10.1% | \n",
" 32.8% | \n",
" 53.0% | \n",
" 4.1% | \n",
"
\n",
" \n",
"
\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",
" mostly false | \n",
" mixture of true and false | \n",
" mostly true | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" 6.2% | \n",
" 19.4% | \n",
" 74.4% | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" 6.2% | \n",
" 22.9% | \n",
" 70.8% | \n",
"
\n",
" \n",
" The Other 98% | \n",
" 6.1% | \n",
" 12.2% | \n",
" 81.7% | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" 0.0% | \n",
" 1.1% | \n",
" 98.9% | \n",
"
\n",
" \n",
" CNN Politics | \n",
" 0.0% | \n",
" 1.0% | \n",
" 99.0% | \n",
"
\n",
" \n",
" Politico | \n",
" 0.0% | \n",
" 0.4% | \n",
" 99.6% | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" 14.6% | \n",
" 26.3% | \n",
" 59.0% | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" 24.1% | \n",
" 24.1% | \n",
" 51.9% | \n",
"
\n",
" \n",
" Right Wing News | \n",
" 10.5% | \n",
" 34.2% | \n",
" 55.3% | \n",
"
\n",
" \n",
"
\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",
" Date Published | \n",
" 2016-09-19 | \n",
" 2016-09-20 | \n",
" 2016-09-21 | \n",
" 2016-09-22 | \n",
" 2016-09-23 | \n",
" 2016-09-26 | \n",
" 2016-09-27 | \n",
" Avg. Per Day | \n",
"
\n",
" \n",
" Category | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" 55 | \n",
" 70 | \n",
" 58 | \n",
" 54 | \n",
" 66 | \n",
" 80 | \n",
" 88 | \n",
" 67 | \n",
"
\n",
" \n",
" mainstream | \n",
" 154 | \n",
" 156 | \n",
" 151 | \n",
" 146 | \n",
" 135 | \n",
" 223 | \n",
" 180 | \n",
" 164 | \n",
"
\n",
" \n",
" right | \n",
" 97 | \n",
" 91 | \n",
" 97 | \n",
" 93 | \n",
" 93 | \n",
" 100 | \n",
" 95 | \n",
" 95 | \n",
"
\n",
" \n",
"
\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",
" Date Published | \n",
" 2016-09-19 | \n",
" 2016-09-20 | \n",
" 2016-09-21 | \n",
" 2016-09-22 | \n",
" 2016-09-23 | \n",
" 2016-09-26 | \n",
" 2016-09-27 | \n",
" Avg. Per Day | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" 22 | \n",
" 18 | \n",
" 17 | \n",
" 21 | \n",
" 22 | \n",
" 17 | \n",
" 23 | \n",
" 20 | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" 20 | \n",
" 30 | \n",
" 20 | \n",
" 19 | \n",
" 29 | \n",
" 47 | \n",
" 44 | \n",
" 30 | \n",
"
\n",
" \n",
" The Other 98% | \n",
" 13 | \n",
" 22 | \n",
" 21 | \n",
" 14 | \n",
" 15 | \n",
" 16 | \n",
" 21 | \n",
" 17 | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" 36 | \n",
" 22 | \n",
" 23 | \n",
" 21 | \n",
" 22 | \n",
" 47 | \n",
" 29 | \n",
" 29 | \n",
"
\n",
" \n",
" CNN Politics | \n",
" 54 | \n",
" 61 | \n",
" 53 | \n",
" 62 | \n",
" 48 | \n",
" 66 | \n",
" 65 | \n",
" 58 | \n",
"
\n",
" \n",
" Politico | \n",
" 64 | \n",
" 73 | \n",
" 75 | \n",
" 63 | \n",
" 65 | \n",
" 110 | \n",
" 86 | \n",
" 77 | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" 41 | \n",
" 41 | \n",
" 42 | \n",
" 41 | \n",
" 41 | \n",
" 41 | \n",
" 39 | \n",
" 41 | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" 19 | \n",
" 16 | \n",
" 17 | \n",
" 15 | \n",
" 15 | \n",
" 15 | \n",
" 15 | \n",
" 16 | \n",
"
\n",
" \n",
" Right Wing News | \n",
" 37 | \n",
" 34 | \n",
" 38 | \n",
" 37 | \n",
" 37 | \n",
" 44 | \n",
" 41 | \n",
" 38 | \n",
"
\n",
" \n",
"
\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",
" Rating | \n",
" mostly false | \n",
" mixture of true and false | \n",
" mostly true | \n",
" no factual content | \n",
" total | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" Post Type | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" link | \n",
" 8 | \n",
" 25 | \n",
" 94 | \n",
" 7 | \n",
" 134 | \n",
"
\n",
" \n",
" photo | \n",
" 0 | \n",
" 0 | \n",
" 1 | \n",
" 3 | \n",
" 4 | \n",
"
\n",
" \n",
" video | \n",
" 0 | \n",
" 0 | \n",
" 1 | \n",
" 1 | \n",
" 2 | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" link | \n",
" 7 | \n",
" 26 | \n",
" 60 | \n",
" 1 | \n",
" 94 | \n",
"
\n",
" \n",
" photo | \n",
" 2 | \n",
" 2 | \n",
" 25 | \n",
" 49 | \n",
" 78 | \n",
"
\n",
" \n",
" video | \n",
" 0 | \n",
" 5 | \n",
" 17 | \n",
" 15 | \n",
" 37 | \n",
"
\n",
" \n",
" The Other 98% | \n",
" link | \n",
" 1 | \n",
" 7 | \n",
" 40 | \n",
" 3 | \n",
" 51 | \n",
"
\n",
" \n",
" photo | \n",
" 4 | \n",
" 0 | \n",
" 11 | \n",
" 26 | \n",
" 41 | \n",
"
\n",
" \n",
" video | \n",
" 0 | \n",
" 3 | \n",
" 16 | \n",
" 11 | \n",
" 30 | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" link | \n",
" 0 | \n",
" 2 | \n",
" 104 | \n",
" 2 | \n",
" 108 | \n",
"
\n",
" \n",
" photo | \n",
" 0 | \n",
" 0 | \n",
" 13 | \n",
" 0 | \n",
" 13 | \n",
"
\n",
" \n",
" text | \n",
" 0 | \n",
" 0 | \n",
" 1 | \n",
" 0 | \n",
" 1 | \n",
"
\n",
" \n",
" video | \n",
" 0 | \n",
" 0 | \n",
" 54 | \n",
" 24 | \n",
" 78 | \n",
"
\n",
" \n",
" CNN Politics | \n",
" link | \n",
" 0 | \n",
" 4 | \n",
" 316 | \n",
" 10 | \n",
" 330 | \n",
"
\n",
" \n",
" photo | \n",
" 0 | \n",
" 0 | \n",
" 3 | \n",
" 5 | \n",
" 8 | \n",
"
\n",
" \n",
" text | \n",
" 0 | \n",
" 0 | \n",
" 1 | \n",
" 0 | \n",
" 1 | \n",
"
\n",
" \n",
" video | \n",
" 0 | \n",
" 0 | \n",
" 65 | \n",
" 5 | \n",
" 70 | \n",
"
\n",
" \n",
" Politico | \n",
" link | \n",
" 0 | \n",
" 2 | \n",
" 458 | \n",
" 3 | \n",
" 463 | \n",
"
\n",
" \n",
" photo | \n",
" 0 | \n",
" 0 | \n",
" 5 | \n",
" 2 | \n",
" 7 | \n",
"
\n",
" \n",
" text | \n",
" 0 | \n",
" 0 | \n",
" 1 | \n",
" 0 | \n",
" 1 | \n",
"
\n",
" \n",
" video | \n",
" 0 | \n",
" 0 | \n",
" 64 | \n",
" 1 | \n",
" 65 | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" link | \n",
" 27 | \n",
" 50 | \n",
" 117 | \n",
" 37 | \n",
" 231 | \n",
"
\n",
" \n",
" photo | \n",
" 3 | \n",
" 3 | \n",
" 3 | \n",
" 37 | \n",
" 46 | \n",
"
\n",
" \n",
" video | \n",
" 0 | \n",
" 1 | \n",
" 1 | \n",
" 7 | \n",
" 9 | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" link | \n",
" 26 | \n",
" 25 | \n",
" 56 | \n",
" 4 | \n",
" 111 | \n",
"
\n",
" \n",
" text | \n",
" 0 | \n",
" 1 | \n",
" 0 | \n",
" 0 | \n",
" 1 | \n",
"
\n",
" \n",
" Right Wing News | \n",
" link | \n",
" 27 | \n",
" 87 | \n",
" 140 | \n",
" 4 | \n",
" 258 | \n",
"
\n",
" \n",
" photo | \n",
" 0 | \n",
" 1 | \n",
" 2 | \n",
" 7 | \n",
" 10 | \n",
"
\n",
" \n",
"
\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",
" share_count | \n",
" reaction_count | \n",
" comment_count | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" 563 | \n",
" 2230 | \n",
" 271 | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" 10931 | \n",
" 22360 | \n",
" 1205 | \n",
"
\n",
" \n",
" The Other 98% | \n",
" 3942 | \n",
" 12083 | \n",
" 521 | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" 13 | \n",
" 80 | \n",
" 28 | \n",
"
\n",
" \n",
" CNN Politics | \n",
" 50 | \n",
" 340 | \n",
" 194 | \n",
"
\n",
" \n",
" Politico | \n",
" 33 | \n",
" 314 | \n",
" 95 | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" 92 | \n",
" 186 | \n",
" 22 | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" 947 | \n",
" 2245 | \n",
" 214 | \n",
"
\n",
" \n",
" Right Wing News | \n",
" 266 | \n",
" 913 | \n",
" 91 | \n",
"
\n",
" \n",
"
\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",
" share_count | \n",
" reaction_count | \n",
" comment_count | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" 1270 | \n",
" 3120 | \n",
" 392 | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" 29205 | \n",
" 34669 | \n",
" 2858 | \n",
"
\n",
" \n",
" The Other 98% | \n",
" 18007 | \n",
" 20971 | \n",
" 915 | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" 44 | \n",
" 177 | \n",
" 71 | \n",
"
\n",
" \n",
" CNN Politics | \n",
" 183 | \n",
" 678 | \n",
" 322 | \n",
"
\n",
" \n",
" Politico | \n",
" 182 | \n",
" 900 | \n",
" 170 | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" 616 | \n",
" 520 | \n",
" 79 | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" 2474 | \n",
" 3685 | \n",
" 516 | \n",
"
\n",
" \n",
" Right Wing News | \n",
" 1398 | \n",
" 2454 | \n",
" 360 | \n",
"
\n",
" \n",
"
\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",
" Rating | \n",
" mixture of true and false | \n",
" mostly false | \n",
" mostly true | \n",
" no factual content | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" 25 | \n",
" 8 | \n",
" 96 | \n",
" 11 | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" 33 | \n",
" 9 | \n",
" 102 | \n",
" 65 | \n",
"
\n",
" \n",
" The Other 98% | \n",
" 10 | \n",
" 5 | \n",
" 67 | \n",
" 40 | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" 2 | \n",
" 0 | \n",
" 172 | \n",
" 26 | \n",
"
\n",
" \n",
" CNN Politics | \n",
" 4 | \n",
" 0 | \n",
" 385 | \n",
" 20 | \n",
"
\n",
" \n",
" Politico | \n",
" 2 | \n",
" 0 | \n",
" 528 | \n",
" 6 | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" 54 | \n",
" 30 | \n",
" 121 | \n",
" 81 | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" 26 | \n",
" 26 | \n",
" 56 | \n",
" 4 | \n",
"
\n",
" \n",
" Right Wing News | \n",
" 88 | \n",
" 27 | \n",
" 142 | \n",
" 11 | \n",
"
\n",
" \n",
"
\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",
" share_count | \n",
" reaction_count | \n",
" comment_count | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" Rating | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" mixture of true and false | \n",
" 1132 | \n",
" 3087 | \n",
" 402 | \n",
"
\n",
" \n",
" mostly false | \n",
" 285 | \n",
" 1910 | \n",
" 394 | \n",
"
\n",
" \n",
" mostly true | \n",
" 523 | \n",
" 1966 | \n",
" 235 | \n",
"
\n",
" \n",
" no factual content | \n",
" 399 | \n",
" 2351 | \n",
" 153 | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" mixture of true and false | \n",
" 10654 | \n",
" 17085 | \n",
" 1461 | \n",
"
\n",
" \n",
" mostly false | \n",
" 5541 | \n",
" 17525 | \n",
" 638 | \n",
"
\n",
" \n",
" mostly true | \n",
" 7755 | \n",
" 15951 | \n",
" 1090 | \n",
"
\n",
" \n",
" no factual content | \n",
" 18345 | \n",
" 37326 | \n",
" 1396 | \n",
"
\n",
" \n",
" The Other 98% | \n",
" mixture of true and false | \n",
" 4749 | \n",
" 9040 | \n",
" 742 | \n",
"
\n",
" \n",
" mostly false | \n",
" 11571 | \n",
" 19682 | \n",
" 930 | \n",
"
\n",
" \n",
" mostly true | \n",
" 2896 | \n",
" 7082 | \n",
" 372 | \n",
"
\n",
" \n",
" no factual content | \n",
" 10337 | \n",
" 25951 | \n",
" 638 | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" mixture of true and false | \n",
" 76 | \n",
" 479 | \n",
" 59 | \n",
"
\n",
" \n",
" mostly true | \n",
" 12 | \n",
" 78 | \n",
" 28 | \n",
"
\n",
" \n",
" no factual content | \n",
" 38 | \n",
" 78 | \n",
" 23 | \n",
"
\n",
" \n",
" CNN Politics | \n",
" mixture of true and false | \n",
" 270 | \n",
" 1374 | \n",
" 315 | \n",
"
\n",
" \n",
" mostly true | \n",
" 48 | \n",
" 343 | \n",
" 194 | \n",
"
\n",
" \n",
" no factual content | \n",
" 64 | \n",
" 245 | \n",
" 184 | \n",
"
\n",
" \n",
" Politico | \n",
" mixture of true and false | \n",
" 7325 | \n",
" 20344 | \n",
" 1510 | \n",
"
\n",
" \n",
" mostly true | \n",
" 33 | \n",
" 310 | \n",
" 96 | \n",
"
\n",
" \n",
" no factual content | \n",
" 48 | \n",
" 309 | \n",
" 48 | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" mixture of true and false | \n",
" 110 | \n",
" 222 | \n",
" 32 | \n",
"
\n",
" \n",
" mostly false | \n",
" 534 | \n",
" 551 | \n",
" 55 | \n",
"
\n",
" \n",
" mostly true | \n",
" 46 | \n",
" 111 | \n",
" 17 | \n",
"
\n",
" \n",
" no factual content | \n",
" 250 | \n",
" 300 | \n",
" 17 | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" mixture of true and false | \n",
" 342 | \n",
" 922 | \n",
" 140 | \n",
"
\n",
" \n",
" mostly false | \n",
" 1623 | \n",
" 2455 | \n",
" 276 | \n",
"
\n",
" \n",
" mostly true | \n",
" 908 | \n",
" 2476 | \n",
" 191 | \n",
"
\n",
" \n",
" no factual content | \n",
" 2025 | \n",
" 4264 | \n",
" 262 | \n",
"
\n",
" \n",
" Right Wing News | \n",
" mixture of true and false | \n",
" 429 | \n",
" 1270 | \n",
" 132 | \n",
"
\n",
" \n",
" mostly false | \n",
" 781 | \n",
" 1430 | \n",
" 192 | \n",
"
\n",
" \n",
" mostly true | \n",
" 91 | \n",
" 400 | \n",
" 50 | \n",
"
\n",
" \n",
" no factual content | \n",
" 4933 | \n",
" 8539 | \n",
" 201 | \n",
"
\n",
" \n",
"
\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",
" share_count | \n",
" reaction_count | \n",
" comment_count | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" Rating | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" mixture of true and false | \n",
" 1516 | \n",
" 3451 | \n",
" 460 | \n",
"
\n",
" \n",
" mostly false | \n",
" 1891 | \n",
" 4004 | \n",
" 704 | \n",
"
\n",
" \n",
" mostly true | \n",
" 1005 | \n",
" 2800 | \n",
" 368 | \n",
"
\n",
" \n",
" no factual content | \n",
" 2766 | \n",
" 4520 | \n",
" 227 | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" mixture of true and false | \n",
" 26036 | \n",
" 28933 | \n",
" 2924 | \n",
"
\n",
" \n",
" mostly false | \n",
" 10603 | \n",
" 22854 | \n",
" 1426 | \n",
"
\n",
" \n",
" mostly true | \n",
" 16215 | \n",
" 25000 | \n",
" 1624 | \n",
"
\n",
" \n",
" no factual content | \n",
" 55171 | \n",
" 54388 | \n",
" 4959 | \n",
"
\n",
" \n",
" The Other 98% | \n",
" mixture of true and false | \n",
" 9544 | \n",
" 11270 | \n",
" 942 | \n",
"
\n",
" \n",
" mostly false | \n",
" 13738 | \n",
" 24557 | \n",
" 1051 | \n",
"
\n",
" \n",
" mostly true | \n",
" 10765 | \n",
" 14053 | \n",
" 793 | \n",
"
\n",
" \n",
" no factual content | \n",
" 32588 | \n",
" 34363 | \n",
" 1092 | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" mixture of true and false | \n",
" 76 | \n",
" 479 | \n",
" 59 | \n",
"
\n",
" \n",
" mostly true | \n",
" 42 | \n",
" 176 | \n",
" 67 | \n",
"
\n",
" \n",
" no factual content | \n",
" 63 | \n",
" 159 | \n",
" 103 | \n",
"
\n",
" \n",
" CNN Politics | \n",
" mixture of true and false | \n",
" 239 | \n",
" 1327 | \n",
" 262 | \n",
"
\n",
" \n",
" mostly true | \n",
" 181 | \n",
" 672 | \n",
" 321 | \n",
"
\n",
" \n",
" no factual content | \n",
" 215 | \n",
" 656 | \n",
" 346 | \n",
"
\n",
" \n",
" Politico | \n",
" mixture of true and false | \n",
" 7325 | \n",
" 20344 | \n",
" 1510 | \n",
"
\n",
" \n",
" mostly true | \n",
" 156 | \n",
" 832 | \n",
" 166 | \n",
"
\n",
" \n",
" no factual content | \n",
" 83 | \n",
" 420 | \n",
" 54 | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" mixture of true and false | \n",
" 1182 | \n",
" 707 | \n",
" 149 | \n",
"
\n",
" \n",
" mostly false | \n",
" 1300 | \n",
" 926 | \n",
" 89 | \n",
"
\n",
" \n",
" mostly true | \n",
" 263 | \n",
" 300 | \n",
" 67 | \n",
"
\n",
" \n",
" no factual content | \n",
" 506 | \n",
" 573 | \n",
" 49 | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" mixture of true and false | \n",
" 1377 | \n",
" 2489 | \n",
" 553 | \n",
"
\n",
" \n",
" mostly false | \n",
" 3390 | \n",
" 4651 | \n",
" 576 | \n",
"
\n",
" \n",
" mostly true | \n",
" 2543 | \n",
" 3692 | \n",
" 480 | \n",
"
\n",
" \n",
" no factual content | \n",
" 2712 | \n",
" 5089 | \n",
" 390 | \n",
"
\n",
" \n",
" Right Wing News | \n",
" mixture of true and false | \n",
" 1482 | \n",
" 2485 | \n",
" 452 | \n",
"
\n",
" \n",
" mostly false | \n",
" 2366 | \n",
" 3879 | \n",
" 421 | \n",
"
\n",
" \n",
" mostly true | \n",
" 668 | \n",
" 1602 | \n",
" 291 | \n",
"
\n",
" \n",
" no factual content | \n",
" 7713 | \n",
" 9705 | \n",
" 360 | \n",
"
\n",
" \n",
"
\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",
" share_count | \n",
" reaction_count | \n",
" comment_count | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" Post Type | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" link | \n",
" 563 | \n",
" 2195 | \n",
" 262 | \n",
"
\n",
" \n",
" photo | \n",
" 3532 | \n",
" 5814 | \n",
" 534 | \n",
"
\n",
" \n",
" video | \n",
" 275 | \n",
" 1302 | \n",
" 117 | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" link | \n",
" 5130 | \n",
" 10862 | \n",
" 1020 | \n",
"
\n",
" \n",
" photo | \n",
" 18294 | \n",
" 34730 | \n",
" 1290 | \n",
"
\n",
" \n",
" video | \n",
" 26648 | \n",
" 30011 | \n",
" 2287 | \n",
"
\n",
" \n",
" The Other 98% | \n",
" link | \n",
" 3391 | \n",
" 8836 | \n",
" 529 | \n",
"
\n",
" \n",
" photo | \n",
" 12441 | \n",
" 26990 | \n",
" 604 | \n",
"
\n",
" \n",
" video | \n",
" 1598 | \n",
" 4751 | \n",
" 364 | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" link | \n",
" 9 | \n",
" 68 | \n",
" 27 | \n",
"
\n",
" \n",
" photo | \n",
" 6 | \n",
" 30 | \n",
" 14 | \n",
"
\n",
" \n",
" text | \n",
" 2 | \n",
" 5 | \n",
" 2 | \n",
"
\n",
" \n",
" video | \n",
" 37 | \n",
" 138 | \n",
" 32 | \n",
"
\n",
" \n",
" CNN Politics | \n",
" link | \n",
" 36 | \n",
" 284 | \n",
" 177 | \n",
"
\n",
" \n",
" photo | \n",
" 51 | \n",
" 118 | \n",
" 88 | \n",
"
\n",
" \n",
" text | \n",
" 4 | \n",
" 95 | \n",
" 103 | \n",
"
\n",
" \n",
" video | \n",
" 125 | \n",
" 691 | \n",
" 456 | \n",
"
\n",
" \n",
" Politico | \n",
" link | \n",
" 32 | \n",
" 290 | \n",
" 92 | \n",
"
\n",
" \n",
" photo | \n",
" 8 | \n",
" 62 | \n",
" 27 | \n",
"
\n",
" \n",
" text | \n",
" 2 | \n",
" 58 | \n",
" 26 | \n",
"
\n",
" \n",
" video | \n",
" 48 | \n",
" 428 | \n",
" 132 | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" link | \n",
" 70 | \n",
" 154 | \n",
" 20 | \n",
"
\n",
" \n",
" photo | \n",
" 569 | \n",
" 750 | \n",
" 24 | \n",
"
\n",
" \n",
" video | \n",
" 38 | \n",
" 73 | \n",
" 14 | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" link | \n",
" 964 | \n",
" 2263 | \n",
" 224 | \n",
"
\n",
" \n",
" text | \n",
" 3 | \n",
" 47 | \n",
" 7 | \n",
"
\n",
" \n",
" Right Wing News | \n",
" link | \n",
" 246 | \n",
" 824 | \n",
" 87 | \n",
"
\n",
" \n",
" photo | \n",
" 8474 | \n",
" 12115 | \n",
" 180 | \n",
"
\n",
" \n",
"
\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",
" share_count | \n",
" reaction_count | \n",
" comment_count | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" Post Type | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" link | \n",
" 1168 | \n",
" 3028 | \n",
" 391 | \n",
"
\n",
" \n",
" photo | \n",
" 6021 | \n",
" 7128 | \n",
" 578 | \n",
"
\n",
" \n",
" video | \n",
" 275 | \n",
" 1302 | \n",
" 117 | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" link | \n",
" 7463 | \n",
" 16094 | \n",
" 1272 | \n",
"
\n",
" \n",
" photo | \n",
" 25268 | \n",
" 43735 | \n",
" 1604 | \n",
"
\n",
" \n",
" video | \n",
" 97767 | \n",
" 62746 | \n",
" 9531 | \n",
"
\n",
" \n",
" The Other 98% | \n",
" link | \n",
" 10341 | \n",
" 13847 | \n",
" 882 | \n",
"
\n",
" \n",
" photo | \n",
" 28875 | \n",
" 38285 | \n",
" 924 | \n",
"
\n",
" \n",
" video | \n",
" 16712 | \n",
" 9021 | \n",
" 959 | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" link | \n",
" 23 | \n",
" 124 | \n",
" 40 | \n",
"
\n",
" \n",
" photo | \n",
" 9 | \n",
" 51 | \n",
" 21 | \n",
"
\n",
" \n",
" text | \n",
" 2 | \n",
" 5 | \n",
" 2 | \n",
"
\n",
" \n",
" video | \n",
" 90 | \n",
" 273 | \n",
" 125 | \n",
"
\n",
" \n",
" CNN Politics | \n",
" link | \n",
" 176 | \n",
" 604 | \n",
" 256 | \n",
"
\n",
" \n",
" photo | \n",
" 77 | \n",
" 212 | \n",
" 112 | \n",
"
\n",
" \n",
" text | \n",
" 4 | \n",
" 95 | \n",
" 103 | \n",
"
\n",
" \n",
" video | \n",
" 237 | \n",
" 1088 | \n",
" 663 | \n",
"
\n",
" \n",
" Politico | \n",
" link | \n",
" 181 | \n",
" 879 | \n",
" 168 | \n",
"
\n",
" \n",
" photo | \n",
" 77 | \n",
" 299 | \n",
" 31 | \n",
"
\n",
" \n",
" text | \n",
" 2 | \n",
" 58 | \n",
" 26 | \n",
"
\n",
" \n",
" video | \n",
" 201 | \n",
" 1132 | \n",
" 203 | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" link | \n",
" 454 | \n",
" 411 | \n",
" 81 | \n",
"
\n",
" \n",
" photo | \n",
" 1461 | \n",
" 1151 | \n",
" 80 | \n",
"
\n",
" \n",
" video | \n",
" 38 | \n",
" 94 | \n",
" 31 | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" link | \n",
" 2497 | \n",
" 3718 | \n",
" 521 | \n",
"
\n",
" \n",
" text | \n",
" 3 | \n",
" 47 | \n",
" 7 | \n",
"
\n",
" \n",
" Right Wing News | \n",
" link | \n",
" 999 | \n",
" 2048 | \n",
" 358 | \n",
"
\n",
" \n",
" photo | \n",
" 11664 | \n",
" 12928 | \n",
" 408 | \n",
"
\n",
" \n",
"
\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",
" Rating | \n",
" factual content | \n",
" no factual content | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" average | \n",
" 1150 | \n",
" 2766 | \n",
"
\n",
" \n",
" median | \n",
" 578 | \n",
" 399 | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" average | \n",
" 18155 | \n",
" 55171 | \n",
"
\n",
" \n",
" median | \n",
" 7997 | \n",
" 18345 | \n",
"
\n",
" \n",
" The Other 98% | \n",
" average | \n",
" 10820 | \n",
" 32588 | \n",
"
\n",
" \n",
" median | \n",
" 3484 | \n",
" 10337 | \n",
"
\n",
" \n",
" mainstream | \n",
" ABC News Politics | \n",
" average | \n",
" 43 | \n",
" 63 | \n",
"
\n",
" \n",
" median | \n",
" 13 | \n",
" 38 | \n",
"
\n",
" \n",
" CNN Politics | \n",
" average | \n",
" 182 | \n",
" 215 | \n",
"
\n",
" \n",
" median | \n",
" 48 | \n",
" 64 | \n",
"
\n",
" \n",
" Politico | \n",
" average | \n",
" 183 | \n",
" 83 | \n",
"
\n",
" \n",
" median | \n",
" 33 | \n",
" 48 | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" average | \n",
" 656 | \n",
" 506 | \n",
"
\n",
" \n",
" median | \n",
" 75 | \n",
" 250 | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" average | \n",
" 2466 | \n",
" 2712 | \n",
"
\n",
" \n",
" median | \n",
" 947 | \n",
" 2025 | \n",
"
\n",
" \n",
" Right Wing News | \n",
" average | \n",
" 1127 | \n",
" 7713 | \n",
"
\n",
" \n",
" median | \n",
" 246 | \n",
" 4933 | \n",
"
\n",
" \n",
"
\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",
" Rating | \n",
" mostly true | \n",
" everything else | \n",
"
\n",
" \n",
" Category | \n",
" Page | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" left | \n",
" Addicting Info | \n",
" average | \n",
" 1005 | \n",
" 1894 | \n",
"
\n",
" \n",
" median | \n",
" 523 | \n",
" 882 | \n",
"
\n",
" \n",
" Occupy Democrats | \n",
" average | \n",
" 16215 | \n",
" 41812 | \n",
"
\n",
" \n",
" median | \n",
" 7755 | \n",
" 13330 | \n",
"
\n",
" \n",
" The Other 98% | \n",
" average | \n",
" 10765 | \n",
" 26432 | \n",
"
\n",
" \n",
" median | \n",
" 2896 | \n",
" 8236 | \n",
"
\n",
" \n",
" right | \n",
" Eagle Rising | \n",
" average | \n",
" 263 | \n",
" 886 | \n",
"
\n",
" \n",
" median | \n",
" 46 | \n",
" 201 | \n",
"
\n",
" \n",
" Freedom Daily | \n",
" average | \n",
" 2543 | \n",
" 2407 | \n",
"
\n",
" \n",
" median | \n",
" 908 | \n",
" 1142 | \n",
"
\n",
" \n",
" Right Wing News | \n",
" average | \n",
" 668 | \n",
" 2215 | \n",
"
\n",
" \n",
" median | \n",
" 91 | \n",
" 568 | \n",
"
\n",
" \n",
"
\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
}