上一页 1 ··· 93 94 95 96 97 98 99 100 101 ··· 123 下一页
摘要: 思路: 1。第一次需要访问的链接是 https://weibo.com/aj/v6/comment/big?ajwvr=6&more_comment=big&root_comment_id=4215074627189144&is_child_comment=ture&id=4095051414397 阅读全文
posted @ 2018-03-08 10:06 公众号python学习开发 阅读(1315) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*- # @Time : 2018/03/08 10:32 # @Author : cxa # @File : gethtmlandimg.py # @Software: PyCharm import requests from fake_useragent import UserAgent as UA from lxml import ... 阅读全文
posted @ 2018-03-08 09:54 公众号python学习开发 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 问题背景 #给定一个字典{"uid", 2243,"follow", 23,"fans", 20,"weibo", 45}需要把上面的字典字典转换成3条数据插入数据库。# BIZ_ID: 2243, ITEM_NAME:"follow", DEC_VALUE:23# BIZ_ID: 2243, IT 阅读全文
posted @ 2018-03-07 16:55 公众号python学习开发 阅读(161) 评论(0) 推荐(0) 编辑
摘要: from:https://www.jianshu.com/p/8d085e2f2657 这是继SQLAlchemy ORM教程之一:Create后的第二篇教程。在上一篇中我们主要是解决了如何配置ORM系统,建立从类到表的映射的过程,以及如何插入和修改记录。在这个教程中我们主要解决使用的问题。 Que 阅读全文
posted @ 2018-03-07 11:31 公众号python学习开发 阅读(397) 评论(0) 推荐(0) 编辑
摘要: from:https://segmentfault.com/q/1010000000140472 filter: apply the given filtering criterion to a copy of this Query, using SQL expressions.e.g.:sessi 阅读全文
posted @ 2018-03-07 11:28 公众号python学习开发 阅读(6711) 评论(0) 推荐(0) 编辑
摘要: import pandas as pd #数据库操作 import numpy as np from collections import Counter import matplotlib.pyplot as plt #绘图 import jieba from scipy.misc import imread from wordcloud import WordCloud #词云可视化 im... 阅读全文
posted @ 2018-03-06 22:51 公众号python学习开发 阅读(288) 评论(0) 推荐(0) 编辑
摘要: # 根据传入的背景图片路径和词频字典、字体文件,生成指定名称的词云图片 def generate_word_cloud(img_bg_path, top_words_with_freq, font_path, to_save_img_path, background_color='white'): # 读取背景图形 img_bg = imread(img_bg_path) ... 阅读全文
posted @ 2018-03-06 20:50 公众号python学习开发 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 1.collections模块 collections模块自Python 2.4版本开始被引入,包含了dict、set、list、tuple以外的一些特殊的容器类型,分别是: OrderedDict类:排序字典,是字典的子类。引入自2.7。 namedtuple()函数:命名元组,是一个工厂函数。引 阅读全文
posted @ 2018-03-06 20:12 公众号python学习开发 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 上次获取第一次分词之后的内容了 但是数据数据量太大了 ,这时候有个模块就派上用场了collections模块的Counter类 Counter类:为hashable对象计数,是字典的子类。 然后使用most_common方法返回一个TopN列表。如果n没有被指定,则返回所有元素。当多个元素计数值相同 阅读全文
posted @ 2018-03-05 23:21 公众号python学习开发 阅读(271) 评论(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学习开发 阅读(6174) 评论(0) 推荐(0) 编辑
上一页 1 ··· 93 94 95 96 97 98 99 100 101 ··· 123 下一页