- 博客(30)
- 收藏
- 关注
转载 pandas.DataFrame.append()
https://blog.csdn.net/turing365/article/details/80646681https://blog.csdn.net/qq_24509229/article/details/80349898转载于:https://www.cnblogs.com/key221/p/9936450.html
2018-11-09 17:54:00 198
转载 sklearn.model_selection.KFold
https://blog.csdn.net/kancy110/article/details/74910185转载于:https://www.cnblogs.com/key221/p/9931551.html
2018-11-08 19:56:00 151
转载 spyder自动提示
C:\Users\ASUS\Anaconda3\Lib\site-packages\spyder\utils\introspection转载于:https://www.cnblogs.com/key221/p/9915424.html
2018-11-06 15:13:00 636
转载 kNN
import numpy as npimport operatorimport matplotlibimport matplotlib.pyplot as pltimport osdef createDataSet(): group = np.array([[1.0, 1.1], [1.0, 1.0], [0, 0], [0, 0.1]])...
2018-10-03 23:13:00 107
转载 记录
打印小星星row = 1while row <= 5: col = 1 while col <= row: #print("%d" % col) print("*", end="") col += 1 #print("第%d行" % row) print('') ...
2018-09-28 12:20:00 91
转载 爬虫百度贴吧
import requestsfrom bs4 import BeautifulSoupimport redef getHTMLText(url): try: r = requests.get(url) r.raise_for_status() r.encoding = 'utf-8' ...
2018-08-24 15:56:00 120
转载 第三周 1 re库的基本使用
re库的基本使用转载于:https://www.cnblogs.com/key221/p/9524779.html...
2018-08-23 16:48:00 104
转载 第二周 3(实战:中国大学排名定向爬虫)
import requestsfrom bs4 import BeautifulSoupimport bs4def getHTMLText(url): try: r = requests.get(url, timeout=30) r.raise_for_status() ...
2018-08-23 16:39:00 134
转载 第二周 2(信息标记与提取)
标记后的信息可形成信息组织结构,增加了信息维度标记的结构与信息一样具有重要价值标记后的信息可用于通信、存储或展示标记后的信息更利于程序理解和运用 信息标记的三种形式:XMLJSONYAML ...
2018-08-23 15:32:00 105
转载 第二周 1(beautiful soup库)
1 安装pip3 install beautifulsoup4小测:import requestsr = requests.get("http://python123.io/ws/demo.html")from bs4 import BeautifulSoupsoup = BeautifulSoup(r.text, 'html.parser')...
2018-08-22 11:19:00 109
转载 第一周 2(requests库实战)
1 京东商品页面爬取import requestsurl = 'https://item.jd.com/7694047.html'try: r = requests.get(url, timeout=30) r.raise_for_status() r.encoding = r.apparent_encoding print(r...
2018-08-21 18:38:00 71
转载 第一周 1 (requests库)
2. requests.get()方法r = requests.get(url)Requests库的2个重要对象作用:构造一个向服务器请求资源的Request对象,返回一个包含服务器资源的Response对象import requestsr = requests.get("http://www.baidu.com")...
2018-08-21 14:39:00 97
转载 pd.concat()
df = pd.concat([data_train, dummies_Cabin, dummies_Embarked, dummies_Sex, dummies_Pclass], axis=1)df.drop(['Pclass', 'Name', 'Sex', 'Ticket', 'Cabin', 'Embarked'], axis=1, inplace=True)...
2018-07-31 09:32:00 526
转载 pd.get_dummies() onehot编码
dummies_Cabin = pd.get_dummies(data_train['Cabin'], prefix= 'Cabin')dummies_Embarked = pd.get_dummies(data_train['Embarked'], prefix= 'Embarked')dummies_Sex = pd.get_dummies(data_train[...
2018-07-31 09:24:00 731
转载 pandas as_matrix()
df = pd.DataFrame(np.arange(12).reshape(3, 4))dfOut[10]: 0 1 2 30 0 1 2 31 4 5 6 72 8 9 10 11df.as_matrix()Out[11]: array([[ 0, 1, 2, 3], ...
2018-07-31 09:06:00 3402
转载 pd.notnull pd.isnull transpose
Survived_cabin = data_train.Survived[pd.notnull(data_train.Cabin)].value_counts()Survived_nocabin = data_train.Survived[pd.isnull(data_train.Cabin)].value_counts()df=pd.DataFrame({u'有':Surv...
2018-07-30 21:30:00 161
转载 plt.legend
plt.legend((u'头等舱', u'2等舱', u'3等舱'), loc='best')转载于:https://www.cnblogs.com/key221/p/9392387.html
2018-07-30 19:48:00 1447
转载 plt.grid
plt.grid(b=None, which='major', axis='both', **kwargs) Turn the axes grids on or off. 显示网格plt.grid(b=True, which='major', axis='y')Set the axes grids on or off; *b* is a boolean. (For...
2018-07-30 18:57:00 1142
转载 matplotlib正常显示中文
import matplotlib.pyplot as pltplt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签plt.rcParams['axes.unicode_minus']=False #用来正常显示负号#有中文出现的情况,需要u'内容'转载于:https://www.cnblogs.com/key221/...
2018-07-30 17:28:00 112
转载 plt.subplot2grid()函数
plt.subplot2gridplt.subplot2grid(shape, loc, rowspan=1, colspan=1, fig=None, **kwargs) shape : sequence of 2 ints loc : sequence of 2 ints rowspan : int Number of rows for the...
2018-07-30 17:19:00 1758
转载 python日常学习
1 Python title() 方法返回"标题化"的字符串,就是说所有单词都是以大写开始,其余字母均为小写(见 istitle()) str.title()2 类的继承class Car(): def __init__(self, make, model, year): self.make = make self.mod...
2018-07-29 16:04:00 64
转载 python--随机函数(random,uniform,randint,randrange,shuffle,sample)
转自:https://www.cnblogs.com/chamie/p/4917820.htmlrandom()random()方法:返回随机生成的一个实数,它在[0,1)范围内运用random()方法的语法:import random #random()方法不能直接访问,需要导入random模块,然后通过random静态对象调用该方法rando...
2018-07-29 15:12:00 167
转载 numpy中的random
翻译自官网的文档。转自http://www.mamicode.com/info-detail-507676.html随机抽样(numpy.random)简单的随机数据rand(d0,d1,...,dn)随机值>>> np.random.rand(3,2)array([[ 0.14022471, 0.963...
2018-07-29 15:09:00 149
转载 python笔记
set()函数data = set('like')data.add('love') 把传入的元素作为整体添加到集合中data.update('love') 拆分'love',作为个体传入data.remove('love') 删除方法list.count()转载于:https://www.cnblogs.com/key221/p/8818962.html...
2018-04-13 10:58:00 61
转载 python math
dir(math)['__doc__', '__loader__', '__name__', '__package__', '__spec__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', ...
2018-04-13 09:42:00 53
转载 《机器学习实战》K近邻算法
from numpy import *import operatordef createDataSet(): group = array([[1.0, 1.1], [1.0, 1.0], [0, 0], [0, 0.1]]) labels = ['A', 'A', 'B', 'B'] return group, labelsdef c...
2018-04-12 17:46:00 80
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人