随笔分类 - Python数据分析与实用程序
摘要:使用Pandas读取excel数据如下: df_column = pd.read_excel("测试数据.xlsx",header=None)#取消默认第一行为列名 print(df_column) # 自定义map函数 def test_map(x): return (x+1) df_column
阅读全文
摘要:把“商品价格”列小于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.
阅读全文
摘要:版本二:对某个文件夹下的excel文件循环操作
阅读全文
摘要:思路:利用像素之间的梯度值和虚拟深度值对图像进行重构,根据灰度变化来模拟人类视觉的明暗程度。 Note:需要安装第三方库pillow
阅读全文
摘要:第一部分 英文文本分析词频 以Hamlet文本为例,文本下载链接: https://python123.io/resources/pye/hamlet.txt #CalHamletV1.py #hamlet文本下载链接:https://python123.io/resources/pye/hamle
阅读全文
摘要:import PyPDF2 filenames = ['cover.pdf', 'content1.pdf', 'content2.pdf', 'content3.pdf'] merger = PyPDF2.PdfFileMerger() for filename in filenames: merger.append(PyPDF2.PdfFileReader(filename)) merger.
阅读全文
摘要:Note: 坐标(400,400)是以电脑屏幕左上角为原点; 由于本程序是死循环,在PyCharm中按“Ctrl+F2”可中断程序。
阅读全文

浙公网安备 33010602011771号