摘要: 上次获取第一次分词之后的内容了 但是数据数据量太大了 ,这时候有个模块就派上用场了collections模块的Counter类 Counter类:为hashable对象计数,是字典的子类。 然后使用most_common方法返回一个TopN列表。如果n没有被指定,则返回所有元素。当多个元素计数值相同 阅读全文
posted @ 2018-03-05 23:21 公众号python学习开发 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 转载自:http://www.hankcs.com/nlp/part-of-speech-tagging.html 词性标注(Part-of-Speech tagging 或POS tagging),又称词类标注或者简称标注,是指为分词结果中的每个单词标注一个正确的词性的程序,也即确定每个词是名词、 阅读全文
posted @ 2018-03-05 23:06 公众号python学习开发 阅读(6187) 评论(0) 推荐(0) 编辑
摘要: import requests from lxml import html import time import pandas as pd from sqlalchemy import create_engine import traceback from fake_useragent import UserAgent as UA #使用其random方法获取随机ua class ZhaoPi... 阅读全文
posted @ 2018-03-05 22:59 公众号python学习开发 阅读(860) 评论(0) 推荐(0) 编辑
摘要: 如何获取数据点击这里 数据样式大概这样。然后下面我分析的是工作要求 也就是那边的绿框那一列。 运行完上面的程序得到的文件结构如下 阅读全文
posted @ 2018-03-05 22:56 公众号python学习开发 阅读(443) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*- # @Time : 2018/03/05 10:57 # @Author : cxa # @File : testDataTime.py # @Software: PyCharm import datetime import time # 今天 12:36 # 34分钟前 # 20秒前 # 2月26日 09:38 #统一格式化成时间类... 阅读全文
posted @ 2018-03-05 14:32 公众号python学习开发 阅读(389) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*- import os import time import logging import sys log_dir1=os.path.join(os.path.dirname(os.path.dirname(__file__)),"logs") today = time.strftime('%Y%m%d', time.localtime(time.ti... 阅读全文
posted @ 2018-03-05 12:29 公众号python学习开发 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 1 创建链接基础类。 2.设计需要的表的字段 3.映射到实体 4.创建表 阅读全文
posted @ 2018-03-05 10:59 公众号python学习开发 阅读(414) 评论(0) 推荐(0) 编辑
摘要: 最近用mysqlalchmy的时候遇到了 sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1366, "Incorrect string value: '\\xF0\\xA0\\x88\\x8C\\xEF\\xBC...' for 阅读全文
posted @ 2018-03-05 10:36 公众号python学习开发 阅读(2325) 评论(0) 推荐(0) 编辑