会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Live2D
鸟-叔
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
下一页
2020年5月14日
UnicodeEncodeError: 'gbk' codec can't encode character '\xb2' in position 7: illegal multibyte sequence解决之一
摘要: 当python出现这种UnicodeEncodeError: 'gbk' codec can't encode character '\xb2' in position 7: illegal multibyte sequence 报错的原因是Python中的print内置方法为“utf-8”,所以解
阅读全文
posted @ 2020-05-14 15:07 鸟-叔
阅读(2660)
评论(0)
推荐(0)
2020年5月7日
Python之Word转PDF
摘要: #coding=utf-8from win32com.client import gencachefrom win32com.client import constants, gencachedef createPdf(wordPath, pdfPath): """ word转pdf :param
阅读全文
posted @ 2020-05-07 18:56 鸟-叔
阅读(5244)
评论(0)
推荐(0)
Python之word表格操作
摘要: #coding=utf-8from docx import Documentfrom docx.shared import Ptfrom docx.shared import Inchesfrom docx.oxml.ns import qnimport docx#打开文档from urllib3.
阅读全文
posted @ 2020-05-07 16:13 鸟-叔
阅读(6446)
评论(0)
推荐(0)
2020年4月21日
Python清除常见的网页空格格式
摘要: def clean(string): pattern = re.compile(r'<[^>]+>', re.S) string = pattern.sub('', string) string = string.replace('\n', ' ').replace('\r', ' ').repla
阅读全文
posted @ 2020-04-21 12:28 鸟-叔
阅读(588)
评论(0)
推荐(0)
2020年4月8日
Python之布隆过滤器的lambda函数
摘要: from pybloom_live import BloomFilter import pandas as pd df = pd.read_csv(fileName,encoding="utf-8") bf = pd.read_csv(capacity = df.shope[0]+100,error
阅读全文
posted @ 2020-04-08 10:28 鸟-叔
阅读(248)
评论(0)
推荐(0)
2020年4月7日
OSError: Initializing from file failed
摘要: 这种报错一般由两种情况引起: 一、函数参数为路径而非文件名, 二、函数参数带有中文 第一种的解决就是将文件名添加到路径后即可 第二种是在read_csv()方法时指定engine为Python就可以了,当然还可以先使用 with open()函数先打开在读取 pd.read_csv(read_fil
阅读全文
posted @ 2020-04-07 10:03 鸟-叔
阅读(3600)
评论(0)
推荐(0)
2020年4月1日
python之邮件提醒
摘要: list1 = ['邮箱1', '邮箱2', '邮箱3']for username_recv in list1: mailserver = "smtp.163.com" # 邮箱服务器地址 username_send = '发送方邮箱名' # 邮箱用户名 password = '邮箱名' # 邮箱密
阅读全文
posted @ 2020-04-01 12:23 鸟-叔
阅读(453)
评论(0)
推荐(0)
python之经纬度的获取
摘要: import xlrdfrom xlrd import xldate_as_tupleimport jsonimport requestsimport datetimeimport openpyxlimport osimport timefrom bs4 import BeautifulSoupim
阅读全文
posted @ 2020-04-01 12:18 鸟-叔
阅读(5029)
评论(0)
推荐(0)
2020年3月31日
Pandas写入CSV格式
摘要: import pandas as pddef putDataIntoCsv(dataContents, fileName): save = pd.DataFrame(dataContents, columns=titles) if (os.path.exists(fileName)): file =
阅读全文
posted @ 2020-03-31 11:56 鸟-叔
阅读(808)
评论(0)
推荐(0)
2020年3月6日
代码不同之处高亮显示
摘要: 当一个很长的代码写出来之后,又一个需求来了,改了又改,发现行不通了。 当然目前有很多版本控制工具可以进行回溯,例如Git等等,但是直接比较两串代码, 或许更好一点。 https://www.diffchecker.com/ 这是一个网站可以快速甄别不同并以高亮显示。效果如下,方便实用:
阅读全文
posted @ 2020-03-06 10:00 鸟-叔
阅读(215)
评论(0)
推荐(0)
上一页
1
2
3
下一页
公告