摘要: 安装: 用法如下: 结果展示: 阅读全文
posted @ 2019-10-23 19:40 hank-li 阅读(1326) 评论(0) 推荐(0)
摘要: 问题 我想在python中删除字符串中的字符: 但是我必须删除许多字符。 我想到了一个清单 但是如何使用list替换string中的字符? 方法一 from: https://www.itranslater.com/qa/details/2115759020177884160 阅读全文
posted @ 2019-10-23 17:31 hank-li 阅读(621) 评论(0) 推荐(0)
摘要: ``` import os import re import sys import glob import xml.etree.ElementTree as ET def xml_to_txt(indir,outdir): os.chdir(indir) annotations = os.listdir('.') annotations = glob.glob(str(annotations)+' 阅读全文
posted @ 2019-10-23 16:49 hank-li 阅读(6945) 评论(1) 推荐(0)
摘要: ``` import jieba #分词库 import matplotlib.pyplot as plt #数学绘图库 from wordcloud import WordCloud #词云库 #1、读入txt文本数据 file=open("E:\Data\Lofter\demo-txt\demo.txt","r",encoding="utf-8") text =file.read() #2、结 阅读全文
posted @ 2019-10-23 16:44 hank-li 阅读(572) 评论(0) 推荐(0)
摘要: import re test='just for testjust for testtest' pat = re.compile('(?). ?(?=\ 阅读全文
posted @ 2019-10-23 16:12 hank-li 阅读(2999) 评论(0) 推荐(0)