In [1]:
import pandas as pd
import re
import numpy as np
df = pd.read_csv('~/development/Atlas/tag_analysis_ready.csv')
visuals = df[df['visual'] == 1]
In [2]:
visuals = visuals.sort_values('pageviews',ascending=False)
In [3]:
for item in visuals.columns:
if visuals[item].sum() == 0:
visuals = visuals.drop(item,axis=1)
visuals
Out[3]:
tagged_url
abandoned
animals
architecture
art
birds
books
cemeteries
cheat-week
churches
...
transportation
underground-week
video
visual
war
wwii
published
pageviews
upper_quartile
year
581
www.atlasobscura.com/articles/fascinating-phot...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-03-17
314078.0
1
2016.0
2030
www.atlasobscura.com/articles/step-up-2-nature...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-07-17
104788.0
1
2015.0
1049
www.atlasobscura.com/articles/haunting-photos-...
1.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-07-16
51358.0
1
2015.0
2225
www.atlasobscura.com/articles/the-history-of-h...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-11-17
40217.0
1
2015.0
1913
www.atlasobscura.com/articles/scenes-from-a-su...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-06-25
27753.0
1
2015.0
2499
www.atlasobscura.com/articles/the-worlds-most-...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-12-01
25942.0
1
2015.0
2205
www.atlasobscura.com/articles/the-grotesque-10...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-03-25
25112.0
1
2016.0
290
www.atlasobscura.com/articles/beauty-in-the-wr...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-04-29
23626.0
1
2015.0
2252
www.atlasobscura.com/articles/the-lonely-launc...
1.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-03-01
20608.0
1
2016.0
69
www.atlasobscura.com/articles/22-candid-photos...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-10-07
18312.0
1
2015.0
1347
www.atlasobscura.com/articles/livin-on-the-edg...
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-07-13
18218.0
1
2015.0
1755
www.atlasobscura.com/articles/photographing-th...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-12-29
16761.0
1
2015.0
1767
www.atlasobscura.com/articles/photos-of-the-wo...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-07-17
16174.0
1
2015.0
117
www.atlasobscura.com/articles/9-beautiful-port...
0.0
0.0
0.0
0.0
1.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-11-19
14518.0
1
2015.0
259
www.atlasobscura.com/articles/as-above-so-belo...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-03-03
14331.0
1
2016.0
1938
www.atlasobscura.com/articles/see-photos-of-av...
0.0
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
...
1.0
0.0
0.0
1.0
0.0
0.0
2015-09-15
12493.0
1
2015.0
1763
www.atlasobscura.com/articles/photos-of-histor...
0.0
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-09-11
11082.0
1
2015.0
1017
www.atlasobscura.com/articles/glorious-photos-...
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-09-02
10664.0
1
2015.0
1284
www.atlasobscura.com/articles/islands-of-the-u...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-06-03
10144.0
1
2015.0
296
www.atlasobscura.com/articles/behind-the-music...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-04-07
9794.0
0
2015.0
1774
www.atlasobscura.com/articles/places-that-coul...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-04-13
9557.0
0
2015.0
2713
www.atlasobscura.com/articles/when-the-lights-...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-08-25
9432.0
0
2015.0
1267
www.atlasobscura.com/articles/into-the-jaws-of...
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-04-06
9387.0
0
2015.0
2039
www.atlasobscura.com/articles/stunning-photos-...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-10-21
8949.0
0
2015.0
2029
www.atlasobscura.com/articles/stave-churches-a...
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
1.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-03-28
8364.0
0
2016.0
1933
www.atlasobscura.com/articles/see-astronauts-b...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
1.0
1.0
0.0
0.0
2015-09-30
8318.0
0
2015.0
1762
www.atlasobscura.com/articles/photos-of-europe...
1.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
1.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-09-25
8291.0
0
2015.0
164
www.atlasobscura.com/articles/a-photographers-...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-02-19
7977.0
0
2016.0
1944
www.atlasobscura.com/articles/see-yellowstones...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-03-23
7839.0
0
2016.0
553
www.atlasobscura.com/articles/every-book-is-a-...
0.0
0.0
0.0
1.0
0.0
1.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-07-28
7790.0
0
2015.0
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
1180
www.atlasobscura.com/articles/how-to-escape-a-...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-07-24
2140.0
0
2015.0
2034
www.atlasobscura.com/articles/striking-vintage...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-11-13
2123.0
0
2015.0
309
www.atlasobscura.com/articles/big-city-small-t...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-05-07
1964.0
0
2015.0
98
www.atlasobscura.com/articles/360-degrees-of-w...
0.0
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-05-06
1888.0
0
2015.0
1757
www.atlasobscura.com/articles/photographs-of-t...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-01-20
1865.0
0
2016.0
555
www.atlasobscura.com/articles/everything-dies-...
0.0
0.0
0.0
0.0
0.0
0.0
1.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-05-20
1775.0
0
2015.0
55
www.atlasobscura.com/articles/13-extraordinary...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-07-02
1770.0
0
2015.0
1008
www.atlasobscura.com/articles/gh0st5-0f-the-pa...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-04-23
1762.0
0
2015.0
2260
www.atlasobscura.com/articles/the-lunar-coloni...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-07-24
1605.0
0
2015.0
1768
www.atlasobscura.com/articles/photos-of-the-wo...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-01-06
1476.0
0
2016.0
1538
www.atlasobscura.com/articles/not-so-loved-loc...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-06-02
1431.0
0
2015.0
496
www.atlasobscura.com/articles/down-to-earth-uf...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-04-09
1407.0
0
2015.0
2698
www.atlasobscura.com/articles/what-to-wear-in-...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-02-25
1361.0
0
2016.0
1934
www.atlasobscura.com/articles/see-christina-br...
0.0
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-08-13
1331.0
0
2015.0
2509
www.atlasobscura.com/articles/these-beautiful-...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-01-15
1216.0
0
2016.0
2124
www.atlasobscura.com/articles/the-complete-gui...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-07-24
1204.0
0
2015.0
1502
www.atlasobscura.com/articles/nature-is-a-try-...
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-04-08
1160.0
0
2015.0
1844
www.atlasobscura.com/articles/psych-henge-5-am...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-05-05
1102.0
0
2015.0
470
www.atlasobscura.com/articles/design-panoptikum
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-05-27
1071.0
0
2015.0
1939
www.atlasobscura.com/articles/see-ravishing-ph...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-08-03
973.0
0
2015.0
1733
www.atlasobscura.com/articles/photo-of-the-wee...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2013-09-27
928.0
0
2013.0
1747
www.atlasobscura.com/articles/photo-of-the-wee...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-01-25
921.0
0
2016.0
996
www.atlasobscura.com/articles/from-wine-labels...
0.0
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-01-22
916.0
0
2016.0
1750
www.atlasobscura.com/articles/photo-of-the-wee...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-03-07
910.0
0
2016.0
1751
www.atlasobscura.com/articles/photo-of-the-wee...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-03-14
831.0
0
2016.0
1752
www.atlasobscura.com/articles/photo-of-the-wee...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-02-15
771.0
0
2016.0
0
www.atlasobscura.com/articles/10-little-known-...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2015-08-01
651.0
0
2015.0
1745
www.atlasobscura.com/articles/photo-of-the-wee...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2016-01-18
613.0
0
2016.0
1734
www.atlasobscura.com/articles/photo-of-the-wee...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2013-10-04
231.0
0
2013.0
1742
www.atlasobscura.com/articles/photo-of-the-wee...
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
0.0
0.0
1.0
0.0
0.0
2013-12-06
226.0
0
2013.0
117 rows × 39 columns
In [4]:
visuals = visuals[visuals['published']>'2015-08-20']
In [5]:
sr = pd.read_csv('~/Downloads/visuals.csv')
In [ ]:
In [6]:
import PyTagPredict as ptp
In [7]:
visuals.tagged_url = ptp.append_atlas_url('http://',visuals.tagged_url)
/Users/Mike/anaconda/lib/python2.7/site-packages/pandas/core/generic.py:2698: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
self[name] = value
In [8]:
visuals = visuals.set_index('tagged_url').join(sr[['Url','Title','Facebook Shares']].set_index('Url'))
In [9]:
visuals['has_photo_title'] = visuals.Title.str.lower().str.contains("photo|images|picture")
visuals['has_number'] = visuals.Title.str.lower().str.contains("\-?\d+")
In [10]:
visuals.has_photo_title.value_counts()
Out[10]:
True 46
False 26
Name: has_photo_title, dtype: int64
In [11]:
visuals[['pageviews','has_photo_title','Facebook Shares']].corr()
Out[11]:
pageviews
has_photo_title
Facebook Shares
pageviews
1.000000
0.066513
0.933592
has_photo_title
0.066513
1.000000
0.051545
Facebook Shares
0.933592
0.051545
1.000000
In [12]:
np.mean(visuals[1:].pageviews)
Out[12]:
6498.971830985915
In [13]:
visuals.describe()
Out[13]:
abandoned
animals
architecture
art
birds
books
cemeteries
cheat-week
churches
exploration
...
transportation
underground-week
video
visual
war
wwii
pageviews
upper_quartile
year
Facebook Shares
count
72.000000
72.000000
72.000000
72.00000
72.000000
72.000000
72.0
72.0
72.000000
72.000000
...
72.000000
72.000000
72.000000
72.0
72.000000
72.000000
72.000000
72.000000
72.000000
72.000000
mean
0.069444
0.013889
0.069444
0.12500
0.027778
0.027778
0.0
0.0
0.027778
0.013889
...
0.027778
0.027778
0.013889
1.0
0.041667
0.013889
10770.902778
0.166667
2015.430556
531.013889
std
0.255992
0.117851
0.255992
0.33304
0.165489
0.165489
0.0
0.0
0.165489
0.117851
...
0.165489
0.165489
0.117851
0.0
0.201229
0.117851
36855.660202
0.375293
0.498629
1271.270225
min
0.000000
0.000000
0.000000
0.00000
0.000000
0.000000
0.0
0.0
0.000000
0.000000
...
0.000000
0.000000
0.000000
1.0
0.000000
0.000000
613.000000
0.000000
2015.000000
24.000000
25%
0.000000
0.000000
0.000000
0.00000
0.000000
0.000000
0.0
0.0
0.000000
0.000000
...
0.000000
0.000000
0.000000
1.0
0.000000
0.000000
2673.000000
0.000000
2015.000000
106.500000
50%
0.000000
0.000000
0.000000
0.00000
0.000000
0.000000
0.0
0.0
0.000000
0.000000
...
0.000000
0.000000
0.000000
1.0
0.000000
0.000000
4406.500000
0.000000
2015.000000
229.500000
75%
0.000000
0.000000
0.000000
0.00000
0.000000
0.000000
0.0
0.0
0.000000
0.000000
...
0.000000
0.000000
0.000000
1.0
0.000000
0.000000
7873.500000
0.000000
2016.000000
477.000000
max
1.000000
1.000000
1.000000
1.00000
1.000000
1.000000
0.0
0.0
1.000000
1.000000
...
1.000000
1.000000
1.000000
1.0
1.000000
1.000000
314078.000000
1.000000
2016.000000
9966.000000
8 rows × 38 columns
In [ ]:
In [14]:
import matplotlib.pyplot as plt
import numpy as np
np.mean(visuals[1:].pageviews)
Out[14]:
6498.971830985915
In [15]:
np.median(visuals[1:].pageviews)
Out[15]:
4384.0
In [16]:
%matplotlib inline
In [17]:
visuals[visuals['year'] == 2016][1:].plot(y='pageviews',kind='density')
Out[17]:
<matplotlib.axes._subplots.AxesSubplot at 0x116dff750>
In [18]:
visuals['log_pvs'] = np.log(visuals.pageviews)
In [19]:
visuals.sort_values('pageviews',ascending=False)[1:]\
.plot(y='pageviews',kind='hist',bins=100)
Out[19]:
<matplotlib.axes._subplots.AxesSubplot at 0x116e2ef50>
In [20]:
ten_k = visuals[visuals['pageviews']>=10000]
In [21]:
ten_k
Out[21]:
abandoned
animals
architecture
art
birds
books
cemeteries
cheat-week
churches
exploration
...
wwii
published
pageviews
upper_quartile
year
Title
Facebook Shares
has_photo_title
has_number
log_pvs
tagged_url
http://www.atlasobscura.com/articles/fascinating-photos-from-the-secret-trash-collection-in-a-new-york-sanitation-garage
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
2016-03-17
314078.0
1
2016.0
Fascinating Photos from the Secret Trash Colle...
9966
True
False
12.657397
http://www.atlasobscura.com/articles/the-history-of-hazardous-clothing-in-pictures
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
2015-11-17
40217.0
1
2015.0
The History of Hazardous Clothing, in Pictures
3856
True
False
10.602045
http://www.atlasobscura.com/articles/the-worlds-most-isolated-regions-photographed-over-50-years
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
2015-12-01
25942.0
1
2015.0
The Worlds Most Isolated Regions, Photographe...
1084
True
True
10.163619
http://www.atlasobscura.com/articles/the-grotesque-100year-old-wax-figures-on-display-in-brooklyn
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
2016-03-25
25112.0
1
2016.0
The Grotesque 100-Year Old Wax Figures on Disp...
598
False
True
10.131101
http://www.atlasobscura.com/articles/the-lonely-launchpads-and-rusted-rockets-of-americas-abandoned-space-infrastructure
1.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
2016-03-01
20608.0
1
2016.0
The Lonely Launchpads and Rusted Rockets of Am...
773
False
False
9.933435
http://www.atlasobscura.com/articles/22-candid-photos-from-nasas-justreleased-project-apollo-archive
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
2015-10-07
18312.0
1
2015.0
22 Candid Photos from NASA's Just-Released...
741
True
True
9.815312
http://www.atlasobscura.com/articles/photographing-the-tiny-upstate-new-york-town-obsessed-with-ufos
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
2015-12-29
16761.0
1
2015.0
Photographing the Tiny Upstate New York Town O...
710
True
False
9.726810
http://www.atlasobscura.com/articles/9-beautiful-portraits-of-rescued-owls
0.0
0.0
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
...
0.0
2015-11-19
14518.0
1
2015.0
9 Beautiful Portraits of Rescued Owls
3019
False
True
9.583145
http://www.atlasobscura.com/articles/as-above-so-below-fraternal-societies
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
2016-03-03
14331.0
1
2016.0
The Enigmatic Art of Americas Secret Societies
373
False
False
9.570180
http://www.atlasobscura.com/articles/see-photos-of-avantgarde-soviet-bus-shelters-before-they-disappear
0.0
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
2015-09-15
12493.0
1
2015.0
See Avant-Garde Soviet Bus Shelters Before The...
474
False
False
9.432924
http://www.atlasobscura.com/articles/photos-of-historic-bonsai-masterpieces
0.0
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
2015-09-11
11082.0
1
2015.0
Photos of Historic Bonsai Masterpieces
302
True
False
9.313077
http://www.atlasobscura.com/articles/glorious-photos-of-twa-terminal-from-the-golden-age-of-air-travel
0.0
0.0
1.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
...
0.0
2015-09-02
10664.0
1
2015.0
Glorious Photos of TWA Terminal from the Golde...
860
True
False
9.274629
12 rows × 43 columns
In [22]:
print np.mean(ten_k.has_photo_title)
print np.mean(visuals.has_photo_title)
0.583333333333
0.638888888889
In [23]:
ten_k = ten_k.sort_values('pageviews',ascending=False)
In [ ]:
In [ ]:
In [ ]:
In [24]:
visuals[['pageviews','has_photo_title','Facebook Shares','has_number']].corr()
Out[24]:
pageviews
has_photo_title
Facebook Shares
has_number
pageviews
1.000000
0.066513
0.933592
-0.080285
has_photo_title
0.066513
1.000000
0.051545
-0.059049
Facebook Shares
0.933592
0.051545
1.000000
-0.048329
has_number
-0.080285
-0.059049
-0.048329
1.000000
In [25]:
ten_k[['pageviews','Title','year','Facebook Shares','has_number']]
Out[25]:
pageviews
Title
year
Facebook Shares
has_number
tagged_url
http://www.atlasobscura.com/articles/fascinating-photos-from-the-secret-trash-collection-in-a-new-york-sanitation-garage
314078.0
Fascinating Photos from the Secret Trash Colle...
2016.0
9966
False
http://www.atlasobscura.com/articles/the-history-of-hazardous-clothing-in-pictures
40217.0
The History of Hazardous Clothing, in Pictures
2015.0
3856
False
http://www.atlasobscura.com/articles/the-worlds-most-isolated-regions-photographed-over-50-years
25942.0
The Worlds Most Isolated Regions, Photographe...
2015.0
1084
True
http://www.atlasobscura.com/articles/the-grotesque-100year-old-wax-figures-on-display-in-brooklyn
25112.0
The Grotesque 100-Year Old Wax Figures on Disp...
2016.0
598
True
http://www.atlasobscura.com/articles/the-lonely-launchpads-and-rusted-rockets-of-americas-abandoned-space-infrastructure
20608.0
The Lonely Launchpads and Rusted Rockets of Am...
2016.0
773
False
http://www.atlasobscura.com/articles/22-candid-photos-from-nasas-justreleased-project-apollo-archive
18312.0
22 Candid Photos from NASA's Just-Released...
2015.0
741
True
http://www.atlasobscura.com/articles/photographing-the-tiny-upstate-new-york-town-obsessed-with-ufos
16761.0
Photographing the Tiny Upstate New York Town O...
2015.0
710
False
http://www.atlasobscura.com/articles/9-beautiful-portraits-of-rescued-owls
14518.0
9 Beautiful Portraits of Rescued Owls
2015.0
3019
True
http://www.atlasobscura.com/articles/as-above-so-below-fraternal-societies
14331.0
The Enigmatic Art of Americas Secret Societies
2016.0
373
False
http://www.atlasobscura.com/articles/see-photos-of-avantgarde-soviet-bus-shelters-before-they-disappear
12493.0
See Avant-Garde Soviet Bus Shelters Before The...
2015.0
474
False
http://www.atlasobscura.com/articles/photos-of-historic-bonsai-masterpieces
11082.0
Photos of Historic Bonsai Masterpieces
2015.0
302
False
http://www.atlasobscura.com/articles/glorious-photos-of-twa-terminal-from-the-golden-age-of-air-travel
10664.0
Glorious Photos of TWA Terminal from the Golde...
2015.0
860
False
In [26]:
np.mean(ten_k.has_number)
Out[26]:
0.33333333333333331
In [27]:
np.mean(visuals.has_number)
Out[27]:
0.34722222222222221
In [ ]:
Content source: facemelters/data-science
Similar notebooks: