![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
有趣儿的Python
哈乐
这个作者很懒,什么都没留下…
展开
-
Excel表格处理-----Python
文件1 data.py'''Data:2021-08-21Author: Ling LiDescription:使用Pandas拼接多个CSV文件到一个文件(即合并)'''import pandas as pdimport osFolder_Path = r'C:\Users\elxxlng\Videos\Ticket\Data' #要拼接的文件夹及其完整路径,注意不要包含中文SaveFile_Path = r'C:\Users\elxxlng\Videos\Tic原创 2021-12-30 17:36:27 · 647 阅读 · 0 评论 -
Python爬虫——糗百
本文档参考:http://cuiqingcai.com/990.html,在此基础上增加了显示条数的设置。Python版本:2.7相关知识点学习1、urllib2库import urllib2response = urllib2.urlopen("http://www.baidu.com")print response.read()# -*- cod原创 2016-09-11 09:24:07 · 236 阅读 · 0 评论 -
20170220 Part 1 数据结构及算法(一)
人生苦短,我用Python! 之前零零散散的看过一些python的基础知识,现在想好好学习一下了,立帖为证。以《Python cookbook》为学习材料Part 1 数据结构及算法(一)1.1 解压序列赋值给多个变量a.将含有N个元素的序列复制给M(MM=N时>>> list = range(3)>>> x,z,y = list>>> x0>>> y原创 2017-02-20 19:50:14 · 154 阅读 · 0 评论 -
2017222 Part 1 数据结构及算法(二)
Part 1 数据结构及算法(二)1.2 heapq模块1、查找最大或最小的N个元素解决方案:heapq模块中的nlargest()和nsmallest()解决,内部利用堆排序实现,所以复杂度为O(log(N))>>> nums=[1,2,3,4,5,6,7]>>> heapq.nlargest(3,nums)[7, 6, 5]两个函数都会接受一个关键字参数,用原创 2017-02-21 22:13:21 · 161 阅读 · 0 评论