上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 38 下一页
摘要: 安装:pip install -U scikit-learn数据标准化from sklearn import preprocessinga = np.array([[10, 2.7, 3.6], [-100, 5, -2], ... 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(219) 评论(0) 推荐(0) 编辑
摘要: import numpy as npimport pandas as pds = pd.Series([1,3,6, np.nan, 44, 1]) #定义一个序列。 序列就是一列内容,每一行有一个index值print(s)print(s.index)0 ... 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(300) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/red_stone1/article/details/73380517转为markdown那里,md参数要改为markdown 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(1129) 评论(0) 推荐(0) 编辑
摘要: 例子:#!/usr/bin/python# -*- coding: UTF-8 -*-import time# 格式化成2016-03-20 11:45:39形式print time.strftime("%Y-%m-%d %H:%M:%S", time.lo... 阅读全文
posted @ 2018-12-25 09:32 xuejianbest 阅读(958) 评论(0) 推荐(0) 编辑
摘要: 方法1:下载、解压、进入目录,手动运行setup.py install去安装,如源码安装pip:wget http://pypi.python.org/packages/source/p/pip/pip-0.7.2.tar.gz #(替换为最新的包)tar ... 阅读全文
posted @ 2018-12-25 09:32 xuejianbest 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 看代码:s1 = []s2 = []print s1 is s2 # Falseprint s1 == s2 # Trueis判断引用相等性==判断对象相等性(最好只用于数比较)?Python 3.X 版本中没有 cmp 函数(用于字典元素相等性比较),... 阅读全文
posted @ 2018-12-25 09:32 xuejianbest 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 相当于JavaDoc。函数语句块第一行开始,第二行是空行(惯例)。可以用函数名.__doc__获取,help内置函数会获取并展示。def f(): '''Thid is function f. this is describes.''' p... 阅读全文
posted @ 2018-12-25 09:32 xuejianbest 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 文件:poem = '''helloworld'''f = file('book.txt', 'w') #以write模式打开文件,用于写。(写入的文件编码为UTF-8)f.write(poem)f.close()f = file('book.txt') ... 阅读全文
posted @ 2018-12-25 09:32 xuejianbest 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 定义类:class A: def __init__(self, name): self.name = name def say(self): print self.name def __del__(self): ... 阅读全文
posted @ 2018-12-25 09:32 xuejianbest 阅读(221) 评论(0) 推荐(0) 编辑
摘要: import numpy as nparr = np.array([[1,2,3], [2,3,4]])print(arr)print(type(arr))print('number of dim:', arr.ndim)print('shape:', ar... 阅读全文
posted @ 2018-12-25 09:32 xuejianbest 阅读(270) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 38 下一页