python 读取文件
摘要:1、python读取文件 numpy 常用的是loadtxt(file_name) # 默认#后的都会忽略 pandas with
阅读全文
Numpy random arange zeros
摘要:1、 rand(2,4) #2*4 shape 矩阵 rand(d0, d1, …, dn) rand_sample() #随机生成矩阵 2、 prng = np.random.RandomState(123456789) # 定义局部种子prng.rand(2, 4) prng.chisquare
阅读全文
python 规范
摘要:摘自google. https://i.cnblogs.com/PostDone.aspx?postid=9753605&actiontip=%E4%BF%9D%E5%AD%98%E4%BF%AE%E6%94%B9%E6%88%90%E5%8A%9F 1、缩进 Tip 用4个空格来缩进代码 2、代码
阅读全文
pandas 数据结构基础与转换
摘要:pandas 最常用的三种基本数据结构: 1、dataFrame: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html DataFrame相当于有表格(eg excel),有行表头和列表头 1.1初
阅读全文
Python 基础常用
摘要:1、连接符: + 2、基本类型: [] {} () list set :无序,不重复的集合 数据初始化: a = set('a','b'); 或者 {'1'} #只能初始化空的集合; 相关函数: 添加数据: a.add('a'); a.update(['...
阅读全文
centos7 升级python2.7 到python3.6(Centos7 安装Anaconda)
摘要:Anaconda 下载 https://www.anaconda.com/download/#linux 下载文件 Anaconda3-5.2.0-Linux-x86_64.sh bash Anaconda3-5.2.0-Linux-x86_64.sh 一路enter mv /usr/bin/pyt
阅读全文
Python itertools/内置函数
摘要:https://docs.python.org/3.5/library/itertools.html#itertools.starmap // https://docs.python.org/3.5/library/functions.html#map
阅读全文
Python 列表表达式 ,迭代器(2) Yield
摘要:1、yield 暂存为list def max_generator(numbers): current_max = 0 for i in numbers: current_max = max(i, current_max) yield current_max; a = [3, 4, 6, 2, 1, 9, 0, 7, 5, 8] res...
阅读全文
Python 列表表达式 ,迭代器(1)
摘要:Return an iterator that applies function to every item of iterable, yielding the results. If additional iterable arguments are passed, function must t
阅读全文
Python 遍历文件夹 listdir walk 的区别
摘要:二、带有子目录的目录 import ospath = r'C:\Users\Administrator\Desktop\file'for dirpath,dirnames,filenames in os.walk(path):print(dirpath,dirnames,filenames)输出结果
阅读全文
python selenium点滴
摘要:from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriver.Chrome() chrome() 中 的Chrome() 开头字符要大写,小写python 3.6报错
阅读全文