随笔分类 -  Python数据分析与实用程序

摘要:使用Pandas读取excel数据如下: df_column = pd.read_excel("测试数据.xlsx",header=None)#取消默认第一行为列名 print(df_column) # 自定义map函数 def test_map(x): return (x+1) df_column 阅读全文
posted @ 2020-04-11 21:23 不学无墅_NKer 阅读(4680) 评论(0) 推荐(0)
摘要:把“商品价格”列小于0.08的数值修改为0,并输出为新的文件 import pandas as pd df = pd.read_excel("AAA.xlsx") df.loc[df['商品价格'] < 0.08, '商品价格'] = 0 print(df) df.to_excel('newAAA. 阅读全文
posted @ 2019-11-15 19:34 不学无墅_NKer 阅读(941) 评论(0) 推荐(0)
摘要:版本二:对某个文件夹下的excel文件循环操作 阅读全文
posted @ 2019-10-29 20:28 不学无墅_NKer 阅读(587) 评论(0) 推荐(0)
摘要:思路:利用像素之间的梯度值和虚拟深度值对图像进行重构,根据灰度变化来模拟人类视觉的明暗程度。 Note:需要安装第三方库pillow 阅读全文
posted @ 2019-10-13 19:54 不学无墅_NKer 阅读(293) 评论(0) 推荐(0)
摘要:第一部分 英文文本分析词频 以Hamlet文本为例,文本下载链接: https://python123.io/resources/pye/hamlet.txt #CalHamletV1.py #hamlet文本下载链接:https://python123.io/resources/pye/hamle 阅读全文
posted @ 2019-10-07 19:51 不学无墅_NKer 阅读(1848) 评论(0) 推荐(0)
摘要:import PyPDF2 filenames = ['cover.pdf', 'content1.pdf', 'content2.pdf', 'content3.pdf'] merger = PyPDF2.PdfFileMerger() for filename in filenames: merger.append(PyPDF2.PdfFileReader(filename)) merger. 阅读全文
posted @ 2019-10-05 20:34 不学无墅_NKer 阅读(313) 评论(0) 推荐(0)
摘要:Note: 坐标(400,400)是以电脑屏幕左上角为原点; 由于本程序是死循环,在PyCharm中按“Ctrl+F2”可中断程序。 阅读全文
posted @ 2019-10-02 20:06 不学无墅_NKer 阅读(918) 评论(0) 推荐(0)