如何分析一個公眾號數(shù)據(jù)?以抓取記憶承載的閱讀數(shù)點贊數(shù)在看數(shù)留言數(shù)為例
之前分享過文章:
一鍵批量下載微信公眾號文章內(nèi)容/圖片/封面/視頻/音頻,支持導(dǎo)出html和pdf格式,包含閱讀數(shù)/點贊數(shù)/在看數(shù)

于是順便研究下記憶承載,這里抓取了他2021年的所有文章,我放博客上了,方便在線查看:
如何分析一個公眾號的數(shù)據(jù),以記憶承載/深圳衛(wèi)健委的閱讀數(shù)點贊數(shù)在看數(shù)/留言數(shù)為例

蘇生不惑的博客

excel文件包含文章標題,日期,鏈接,封面圖,閱讀數(shù),在看數(shù)和點贊數(shù):

第一篇文章:
我力挺郭敬明先生
接下來用python分析這個號的數(shù)據(jù):
wechat=pd.read_csv('2021記憶承載公眾號歷史文章列表.csv',encoding='utf-8')
文章數(shù)量331篇
len(wechat)
文章作者前5,看數(shù)據(jù)都是碧樹西風(fēng)一個人。
>>> wechat.文章作者.value_counts().sort_values(ascending=False).head(5) 碧樹西風(fēng) ? ?331 Name: 文章作者, dtype: int64
10萬+文章只有一篇:
阿里P7鬧出的這點事兒

>>> wechat[wechat.閱讀數(shù)>100000] ? ? ? ? ? 文章日期 ? ? ? ? ? ? ? ? ?文章標題 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 文章鏈接 ?... ? ? 閱讀數(shù) ?在 看數(shù) ? 點贊數(shù) 139 ?2021-08-08 ?xxx ? ... ?100001 825 ?1742 [1 rows x 12 columns]
閱讀數(shù)總數(shù)8191166
>>> wechat.閱讀數(shù).sum() 8191166
閱讀數(shù)排行前10的文章
>>> wechat[['文章日期','文章標題','文章鏈接','閱讀數(shù)']].sort_values(by='閱讀數(shù)', ascending=False).head(10)

閱讀數(shù)點贊數(shù)在看數(shù)平均值
>>> wechat[['閱讀數(shù)','點贊數(shù)','在看數(shù)']].mean() 閱讀數(shù) ? ?24746.725076 點贊數(shù) ? ? ?622.480363 在看數(shù) ? ? ?260.145015 dtype: float64
頭條的閱讀數(shù)點贊數(shù)在看數(shù)平均值
>>> wechat[wechat.文章位置 == 1][['閱讀數(shù)','點贊數(shù)','在看數(shù)']].mean() 閱讀數(shù) ? ?28413.407407 點贊數(shù) ? ? ?667.126984 在看數(shù) ? ? ?276.148148 dtype: float64
頭條和次條數(shù)分別為189和142:
wechat.groupby('文章位置',as_index=False).agg({"在看數(shù)":'count'}).sort_values(by=['在看數(shù)'],ascending=False).head(5) >>> wechat.文章位置.value_counts().sort_values(ascending=False).head(5) 1 ? ?189 2 ? ?142 Name: 文章位置, dtype: int64 wechat.query('文章位置 == 2')
原創(chuàng)文章331篇,比例100%
wechat.groupby('是否原創(chuàng)')['在看數(shù)'].count().sort_values(ascending=False).head(5) wechat.groupby('是否原創(chuàng)').agg({"在看數(shù)":'count'}).sort_values(by=['在看數(shù)'],ascending=False).head(5) >>> wechat.是否原創(chuàng).value_counts().sort_values(ascending=False).head(5) 是 ? ?331 Name: 是否原創(chuàng), dtype: int64
有原文鏈接數(shù)的文章為0
>>> wechat[wechat["原文鏈接"].notnull()] Empty DataFrame
上半年和下半年文章數(shù)
date='2021-07-01' >>> len(wechat.query(f'文章日期 > "{date}"')) 173