02 2018 档案
python 进程池Pool以及Queue的用法
摘要:进程间的通信 数据输出效果: 阅读全文
posted @ 2018-02-26 00:23 hailuo 阅读(4671) 评论(0) 推荐(0) 编辑
python fork函数
摘要:输出效果如下: 父进程id:30181 30181 父进程30181,我创建的子进程30182 30182 我是子进程30182,父进程30181 说明: 要了解多进程,先来了解操作系统。在类linux操作系统上,操作系统提供一个fork()系统调用。这个函数和普通的函数不太一样。普通的函数调用一次 阅读全文
posted @ 2018-02-25 22:41 hailuo 阅读(367) 评论(0) 推荐(0) 编辑
python 实现连接mysql并读一条数据写到csv一条数据
摘要:import MySQLdb as mdb import csv with open('my.csv', 'w+', newline='') as csv_file: writer = csv.writer(csv_file) #获取 mysql 的链接对象 con = mdb.connect('localhost', 'root', 'root', 'test'); ... 阅读全文
posted @ 2018-02-24 16:17 hailuo 阅读(674) 评论(0) 推荐(0) 编辑
python 使用csv.reader和csv.writer读写文件并转换成dataframe格式
摘要:详解参照http://blog.csdn.net/u011284860/article/details/51031051 阅读全文
posted @ 2018-02-24 12:44 hailuo 阅读(5952) 评论(0) 推荐(1) 编辑
python 下载图片
摘要:import requests from PIL import Image from io import BytesIO url = 'http://image2.buslive.cn/shp/upload/2017/11/29_00545678.jpeg' response = requests.get(url) image = Image.open(BytesIO(response.con... 阅读全文
posted @ 2018-02-23 18:22 hailuo 阅读(241) 评论(0) 推荐(0) 编辑
readline的用法
摘要:with open(r'C:\Users\admin\pycdtest\wanyue\llduizhang_20180207\33_1517970821000304388_119061116',encoding='utf-8') as f: line = f.readline() #print(type(line)) while line: #对line进行操作 lin... 阅读全文
posted @ 2018-02-22 15:51 hailuo 阅读(1953) 评论(0) 推荐(0) 编辑
join合并字符串时使用生成器表达式
摘要:data=['11','pp','aa'] ','.join(str(d) for d in data) 阅读全文
posted @ 2018-02-22 09:25 hailuo 阅读(433) 评论(0) 推荐(0) 编辑
python get_dummies与cut离散化数据
摘要: 阅读全文
posted @ 2018-02-02 09:29 hailuo 阅读(481) 评论(0) 推荐(0) 编辑
python 矢量化的字符串
摘要: 阅读全文
posted @ 2018-02-02 09:20 hailuo 阅读(380) 评论(0) 推荐(0) 编辑


点击右上角即可分享
微信分享提示