我使用pythonrobot_detection在一个大日志文件中检测机器人。我已经将日志文件导入到数据帧中,并开始使用该模块。当数据帧的行数非常少时,这种方法可以很好地工作。否则就会卡住。有没有办法把数据帧分割成更小的部分?或者我如何使用这个模块?你知道吗
#Dataframe
df.columns = ['IP', 'Time', 'Method', 'Resource', 'Status', 'Bytes', 'Referrer', 'Agent']
for item in df['Agent']:
a = robot_detection.is_robot(item)
if a == True:
count = count + 1
else:
ncount = ncount + 1
目前没有回答
相关问题 更多 >
编程相关推荐