python
123cun1
没啥好说的
展开
-
pandas读取文档,转成数组
读取Excel之后,空格转成空字符串,所有值转成字符串并且去掉前后空白字符import pandas as pdio=pd.ExcelFile('filename.xlsx')data = pd.read_excel(io, sheet_name='Sheet1', header=None, keep_default_na=False).applymap(lambda x: str(x).strip())...原创 2021-06-28 17:41:26 · 1277 阅读 · 0 评论 -
python url中文解析
urllib.parse.quote(word)word如果是中文, 会解析成url能识别的url原创 2018-05-05 23:38:05 · 716 阅读 · 0 评论 -
Linux安装并配置python3以及升级python到python3
转载: https://blog.csdn.net/liang19890820/article/details/51079633原创 2018-05-07 15:16:55 · 909 阅读 · 0 评论 -
python-UnicodeEncodeError: 'ascii' codec can't encode characters in position
python2和python3都是用的办法, 非常推荐的方法:import sysimport codecssys.stdout=codecs.getwriter('utf8')(sys.stdout.detach())适用于python2的还有一种办法:import sysreload(sys)sys.setdefaultencoding('utf8')...原创 2018-06-16 23:21:29 · 862 阅读 · 0 评论 -
Linux安装python3以及pip3
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-de...原创 2018-07-02 14:48:08 · 1745 阅读 · 0 评论