自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(31)
  • 收藏
  • 关注

原创 python插件下载地址

http://www.lfd.uci.edu/~gohlke/pythonlibs/

2017-08-28 14:46:39 1227

转载 [转载]Python爬取豆瓣影评并生成词云图代码

# -*- coding:utf-8 -*-'''抓取豆瓣电影某部电影的评论这里以《我不是潘金莲为例》网址链接:https://movie.douban.com/subject/26630781/comments为了抓取全部评论需要先进行登录'''from selenium import webdriverimport timeimport codecsimport jieba

2017-08-24 23:08:33 5401

原创 Sublime搭建Python环境

使用sublime text配置Python开发环境 安装Package Control: Preferences->install Package Control 快捷键ctrl+shift+p 输入install手动:https://packagecontrol.io/installation#st3 先安装 sidebarEnhancements 侧边栏安装下列插件: S

2017-08-24 22:07:08 457

原创 常用浏览器内核驱动下载地址

Firefox: (geckodriver.exe) https://github.com/mozilla/geckodriver/releasesIE: (IEDriverServer) http://selenium-release.storage.googleapis.com/index.html 下载版本需要与selenium版本一致 conda list即可看到Chrom: ht

2017-08-24 19:43:03 1165

原创 Python词云图

新模块介绍:Pickle 如果希望透明地存储 Python 对象,而不丢失其身份和类型等信息,则需要某种形式的对象序列化:它是一个将任意复杂的对象转成对象的文本或二进制表示的过程。同样,必须能够将对象经过序列化后的形式恢复到原有的对象。在 Python 中,这种序列化过程称为 pickle,可以将对象 pickle 成字符串、磁盘上的文件或者任何类似于文件的对象,也可以将这些字符串、文件或任何类似

2017-08-24 15:19:24 2305

转载 最常用的SQL语句

(1)数据记录筛选: sql=”select*from数据表where字段名=字段值orderby字段名[desc]” sql=”select*from数据表where字段名like’%字段值%’orderby字段名[desc]” sql=”selecttop10*from数据表where字段名orderby字段名[desc]” sql=”select*from数据表where字段名

2017-08-18 17:14:40 386

原创 交换友链的几个技巧!

这段时间都没什么时间来优化网站了,但是网站在站长工具查询的权重还是达到1了。 交换友链的几个技巧! 好文分享 第1张 看到这个还挺开心的,虽然百度官方否认权重这一说法,但是毕竟还是挺有效的,权重1以后我就准备开始交换友链了,现在为大家奉献一点交换技巧。 一,查找相关友链交换QQ群并加入群 首先,第一个方法登录自己的QQ并查找和自己网站相关类友链交换群。这个方法我认为是最合适站长们的了,而

2017-08-16 22:53:46 1489

原创 Python-Matplotlib(5) 可视化图表细节

#Colorimport pandas as pdimport matplotlib.pyplot as pltwomen_degrees = pd.read_csv('percent-bachelors-degrees-women-usa.csv')major_cats = ['Biology', 'Computer Science', 'Engineering', 'Math and St

2017-08-13 11:26:17 547

原创 Python-Matplotlib(4) 基于真实数据集的可视化分析

import pandas as pdimport matplotlib.pyplot as pltwomen_degrees = pd.read_csv('percent-bachelors-degrees-women-usa.csv')plt.plot(women_degrees['Year'], women_degrees['Biology'])plt.show()#100-women_

2017-08-13 11:22:00 1998

原创 Python-Matplotlib(4) 直方图与四分图

import pandas as pdimport matplotlib.pyplot as pltreviews = pd.read_csv('fandango_scores.csv')cols = ['FILM', 'RT_user_norm', 'Metacritic_user_nom', 'IMDB_norm', 'Fandango_Ratingvalue']norm_reviews

2017-08-13 11:16:46 5198

原创 Python-Matplotlib(3) 条形图实战

import pandas as pdreviews = pd.read_csv('fandango_scores.csv')cols = ['FILM', 'RT_user_norm', 'Metacritic_user_nom', 'IMDB_norm', 'Fandango_Ratingvalue', 'Fandango_Stars']norm_reviews = reviews[col

2017-08-13 11:11:57 2454

原创 Python-Matplotlib(2)打造一个完整的折线图

import pandas as pdimport matplotlib.pyplot as pltunrate = pd.read_csv('unrate.csv')unrate['DATE'] = pd.to_datetime(unrate['DATE'])first_twelve = unrate[0:12]plt.plot(first_twelve['DATE'], first_tw

2017-08-13 11:07:46 4608

原创 Python-Matplotlib(1)画折线图

import pandas as pdunrate = pd.read_csv('unrate.csv')unrate['DATE'] = pd.to_datetime(unrate['DATE'])print(unrate.head(12))import matplotlib.pyplot as plt#%matplotlib inline#Using the different pyp

2017-08-13 11:01:36 1038

原创 Python-Pandas(6)数据索引变换

import pandas as pd#will return a new DataFrame that is indexed by the values in the specified column #and will drop that column from the DataFrame#without the FILM column dropped fandango = pd.read

2017-08-13 10:07:25 552

原创 Python-Pandas(5)核心数据结构Series详解

#Series (collection of values)#DataFrame (collection of Series objects)#Panel (collection of DataFrame objects)#A Series object can hold many data types, including#float - for representing float val

2017-08-13 09:55:18 343

原创 Python-Pandas(4)自定义函数方法

#specifying axis=1 or axis='columns' will drop any columns that have null valuesdrop_na_columns = titanic_survival.dropna(axis=1)new_titanic_survival = titanic_survival.dropna(axis=0,subset=["Age", "

2017-08-13 09:39:17 2440

原创 Python-Pandas(3)数据预处理

import pandas as pdimport numpy as nptitanic_survival = pd.read_csv("titanic_train.csv")titanic_survival.head()#The Pandas library uses NaN, which stands for "not a number", to indicate a missing va

2017-08-13 09:19:52 431

原创 Python-Pandas(2)数值计算与排序

import pandasfood_info = pandas.read_csv("food_info.csv")col_names = food_info.columns.tolist()print(col_names)print(food_info.head(3))#print food_info["Iron_(mg)"]#div_1000 = food_info["Iron_(mg)

2017-08-12 14:38:27 502

原创 Python-Pandas(1)数据读取与显示,数据样本行列选取

import pandasfood_info = pandas.read_csv("food_info.csv")#print(type(food_info))print food_info.dtypes#first_rows = food_info.head()#print first_rows#print(food_info.head(3))#print food_info.colu

2017-08-12 14:25:18 12701

原创 Numpy知识巩固

import numpy as np#1:8*8棋盘矩阵,其中1、3、5、7行&&0、2、4、6列的元素置为1 1 ,3,5,7列&&0,2,4,6行也是1z = np.zeros((8,8),dtype=int)z[1::2,::2] = 1z[::2,1::2] = 1print z#2:min()、max()函数z = np.random.random((10,10))zmi

2017-08-12 12:43:11 1251

原创 Python-Numpy(5)排序与索引

import numpy as np#data = np.sin(np.arange(20)).reshape(5,4)#print data#ind = data.argmax(axis=0)#print ind#data_max = data[ind, xrange(data.shape[1])]#print data_maxall(data_max == data.max(axi

2017-08-12 12:07:19 546

原创 Python-Numpy(4)常用函数

import numpy as npB = np.arange(3)print B#print np.exp(B)print np.sqrt(B)#Return the floor of the inputa = np.floor(10*np.random.random((3,4)))print a#a.shape## flatten the array#print a.ravel(

2017-08-12 11:54:30 605

原创 Python-Numpy(3)矩阵基本操作

import numpy as npa = np.arange(15).reshape(3, 5)aa.shape#the number of axes (dimensions) of the arraya.ndim#维度a.dtype.name#the total number of elements of the arraya.sizenp.zeros ((3,4)) np.ones(

2017-08-12 11:34:53 1002

原创 Python-Numpy(2)Array数组操作

import numpy#it will compare the second value to each element in the vector# If the values are equal, the Python interpreter returns True; otherwise, it returns Falsevector = numpy.array([5, 10, 15,

2017-08-12 11:22:29 455

原创 Python-Numpy(1)Array数组

import numpyworld_alcohol = numpy.genfromtxt("world_alcohol.txt", delimiter=",")print(type(world_alcohol))#The numpy.array() function can take a list or list of lists as input. When we input a list, w

2017-08-11 08:10:04 1196

原创 Python基础总结(5)

递归阶乘算法:def jc(a): if a==1: return 1 else: return a*jc(a-1)斐波那契数列 1 1 2 3 5 8 13 21 34 55 89 144 |1, 当n=1 Fn|1, 当n=2 |F(n-1)+F(n-2) 当n>2两种算法: 一:迭

2017-08-10 22:58:53 276

原创 Python基础总结(4)

元组:戴上枷锁的列表tuple1=(1,2,3,4,5,6,7,8)更新元素方法temp=('aaa','vvv','ccc','ddd')temp=temp[:2]+('hehe',)+temp[2:]print "{0}.{1}.{2}".format("www","superkingdom","cn")print "{a}.{b}.{c}".format(a="www",b="superk

2017-08-10 22:50:38 174

原创 Python基础总结(3)

文件操作: 读txt文本f=open("aaa.txt","r")g=f.read()print gf.close()写文件f=open("tttt.txt","w")f.write('12646')f.write('\n')f.write('5416')f.close()CSV文件:test_data=[]f=open("unrate.csv","r")data=f.read(

2017-08-10 22:25:55 222

原创 Python基础总结(2)

字典: 列表表示含义:students=["Tom","Jim","Sue","Ann"]scores=[70,80,85,75]indexes=[0,1,2,3]name="Sue"score=0#找名字是苏的成绩是多少for i in indexes: if students[i]=="Sue": score=scores[i]print score就是类

2017-08-10 21:44:45 243

原创 Python基础总结(1)

全干货:语句不加分号 定义变量:days=365 输出: print days print “xxx” 2.7 print(“xxx”)3.0返回类型:type()返回类型 如 type(days)强制转换类型:str(xx) int(xx)运算符:+ - * / 次方:** a的2次方

2017-08-10 21:34:45 231

原创 VMware虚拟机搭MAC系统

开始教学 首先准备软件 VMware虚拟机11 链接:http://pan.baidu.com/s/1dESKbYT 密码:qrwo Mac镜像文件 链接:http://pan.baidu.com/s/1pL0V9az 密码:a529 Unlocker工具 链接:http://pan.baidu.com/s/1kVh0PGb 密码:b5cl首先解压缩unlocker,以管理员身份运行W

2017-08-05 21:55:09 578

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除