随笔分类 -  Python

摘要:支持度(概率):关联度 A&B同时发生(support A&&B) 置信度(概率): A 发生B 发生的概率(贝叶斯)(confidence A=>B)P(B|A) how to achieve Apiori: 1.预值: 最小支持度: 最小置信度: 2.计算; SUPPORT(A=>B)=SUPP 阅读全文
posted @ 2017-11-18 17:07 兔子的尾巴_Mini 阅读(531) 评论(0) 推荐(0)
摘要:elem = driver.find_element_by_id('kw')elem.send_keys(u'php') 相当于在模拟浏览器在百度的首页搜索框中填入了'php' driver.find_element_by_id('su').click() 相当于点击了百度页面上的‘百度一下’按钮 阅读全文
posted @ 2017-11-16 10:16 兔子的尾巴_Mini 阅读(200) 评论(0) 推荐(0)
摘要:i={}header=["a","b","c","d","f"]i["a"]=["1","2"]i["b"]=["1","2"]i["c"]=["1","2"]i["d"]=["1","2"]i["e"]=["1",&q 阅读全文
posted @ 2017-11-15 02:20 兔子的尾巴_Mini 阅读(683) 评论(0) 推荐(0)
摘要:1.在settings.py同级目录下新建文件useragent.py Java代码 # -*-coding:utf-8-*- from scrapy import log import logging import random from scrapy.downloadermiddlewares. 阅读全文
posted @ 2017-11-15 02:19 兔子的尾巴_Mini 阅读(272) 评论(0) 推荐(0)
摘要:#Author:Mini#!/usr/bin/env pythonfrom selenium import webdriverimport timeimport refrom lxml import etreebs=webdriver.PhantomJS()time.sleep(3)url="htt 阅读全文
posted @ 2017-10-31 13:32 兔子的尾巴_Mini 阅读(1174) 评论(0) 推荐(0)
摘要:#Author:Mini#!/usr/bin/env pythonimport urllib.requestimport urllib.parsefrom sina.miniweibo import APIClientdef weibo(): APP_KEY="2911889655" APP_SEC 阅读全文
posted @ 2017-10-30 17:14 兔子的尾巴_Mini 阅读(2638) 评论(1) 推荐(0)
摘要:#Author:Mini#!/usr/bin/env pythonimport pandas as pimport numpy as nimport matplotlib.pylab as pyldata=p.read_csv("F:/BaiduYunDownload/hexun1.csv")a=d 阅读全文
posted @ 2017-10-29 17:04 兔子的尾巴_Mini 阅读(267) 评论(0) 推荐(0)
摘要:matplotlib图标正常显示中文 为了在图表中能够显示中文和负号等,需要下面一段设置: import matplotlib.pyplot as plt plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签 plt.rcParams['axe 阅读全文
posted @ 2017-10-27 15:18 兔子的尾巴_Mini 阅读(1104) 评论(0) 推荐(0)
摘要:#Author:Mini#!/usr/bin/env pythonimport numpy as nc=n.random.random_integers(1,20,12)#(min.max,count)c1=n.random.normal(2,3.0,12)#(mean,a,count) a越大,越 阅读全文
posted @ 2017-10-27 14:46 兔子的尾巴_Mini 阅读(337) 评论(0) 推荐(0)
摘要:#Author:Mini#!/usr/bin/env pythonimport matplotlib.pylab as pylimport numpy as nx=[1,2,3,4,8]y=[3,4,6,7,8]#a1=pyl.plot(x,y) #plot(x,y,color...)折线图a1=p 阅读全文
posted @ 2017-10-27 14:44 兔子的尾巴_Mini 阅读(509) 评论(0) 推荐(0)
摘要:import pandas as pa=p.read_csv("E:/m/b.csv")a1=a.describe()a2=a.sort_values(by="1")#first line(head line)print(a1,a2)b=p.read_excel("E:/m/a.csv")impor 阅读全文
posted @ 2017-10-26 17:25 兔子的尾巴_Mini 阅读(208) 评论(0) 推荐(0)
摘要:numpy: process the data& array pandas:data analysis and explore matplotlib:show with mat &plot scipy: matrix integration statsmodels: statistic Gensim 阅读全文
posted @ 2017-10-24 16:09 兔子的尾巴_Mini 阅读(234) 评论(0) 推荐(0)
摘要:1. define object 2. get data 3. data explore 4. pre-process the data(clean Data Integration data transformation data reduction) 5.mining modle 6. modl 阅读全文
posted @ 2017-10-24 11:33 兔子的尾巴_Mini 阅读(112) 评论(0) 推荐(0)
摘要:json: import json data='{"id":"content","id2":"content2"}' jdata=json.loads(data) jdata.keys() jdata["id"] jdata['id2'] distribution: scrapy + scrapy- 阅读全文
posted @ 2017-10-23 12:14 兔子的尾巴_Mini 阅读(176) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*-import scrapyimport scrapyfrom scrapy.http import Request,FormRequestimport urllib.requestclass Mini1Spider(scrapy.Spider): nam 阅读全文
posted @ 2017-10-10 21:04 兔子的尾巴_Mini 阅读(232) 评论(0) 推荐(0)
摘要:基础 创建数据库 CREATE DATABASE database-name 删除数据库 drop database dbname 备份sql server 创建 备份数据的 device USE master EXEC sp_addumpdevice 'disk', 'testBack', 'c: 阅读全文
posted @ 2017-10-09 11:21 兔子的尾巴_Mini 阅读(147) 评论(0) 推荐(0)
摘要:E:\m\f1>cd ..\ E:\m>scrapy startproject qsautoNew Scrapy project 'qsauto', using template directory 'd:\\users\\administrator\\appdata\\local\\program 阅读全文
posted @ 2017-10-08 14:30 兔子的尾巴_Mini 阅读(135) 评论(0) 推荐(0)
摘要:items: 阅读全文
posted @ 2017-10-08 12:09 兔子的尾巴_Mini 阅读(197) 评论(0) 推荐(0)
摘要:XPath :( html sign) (fast reaction) eg: "/" from head to search eg:/html/head/title : 专家析云南“火流星”空爆事件:不能算“行星撞地球” text() @(html sign) /html/head/title/t 阅读全文
posted @ 2017-10-07 13:48 兔子的尾巴_Mini 阅读(116) 评论(0) 推荐(0)
摘要:Available commands: bench Run quick benchmark test fetch Fetch a URL using the Scrapy downloader genspider Generate new spider using pre-defined templ 阅读全文
posted @ 2017-10-07 12:41 兔子的尾巴_Mini 阅读(169) 评论(0) 推荐(0)