IPython 读取USER_AGENT数据统计操作系统
作者:
绍重先 | 来源:发表于
2018-01-26 16:04 被阅读0次user_devices = [rec['a'] for rec in records if 'a' in rec]
# <codecell>
def device_counts(seq):
counts = {}
devices = {'Windows','compatible','iPhone','iPad','BlackBerry','Macintosh','Linux'}
for name in devices:
counts[name] = 0
for x in seq:
for name in devices:
if name in x:
counts[name]+=1
return counts
# <codecell>
acounts = device_counts(user_devices)
本文标题:IPython 读取USER_AGENT数据统计操作系统
本文链接:https://www.haomeiwen.com/subject/ljlwaxtx.html
网友评论