摘要:
人形词云,根据图片黑白形状,绘制词云: #coding:utf-8 """ Masked wordcloud Using a mask you can generate wordclouds in arbitrary shapes. """ from os import path from PIL
阅读全文
posted @ 2020-03-09 11:24
共感的艺术
阅读(1664)
推荐(0)
编辑
摘要:
汉化的simple词云: #coding:utf-8 """ Minimal Example Generating a square wordcloud from the US constitution using default arguments. """ from os import path
阅读全文
posted @ 2020-03-09 11:22
共感的艺术
阅读(164)
推荐(0)
编辑
摘要:
对于数据的平均值处理: def checkstr(mystr): try: num=eval(mystr) return True except: return False file=r"D:\python爬虫视频\爬虫代码\处理爬虫数据排序\nasa.txt" readfile=open(file
阅读全文
posted @ 2020-03-09 11:18
共感的艺术
阅读(545)
推荐(0)
编辑
摘要:
文字替换成函数返回数字进行排序: def xueli(study): if study == "博士后": return 10 elif study == "博士": return 9 elif study == "硕士": return 8 elif study == "本科": return 7
阅读全文
posted @ 2020-03-09 11:17
共感的艺术
阅读(252)
推荐(0)
编辑
摘要:
校验 mystr=input("输入数据") try: num=eval(mystr) print(num) print("ok") except: print("失败")
阅读全文
posted @ 2020-03-09 11:16
共感的艺术
阅读(129)
推荐(0)
编辑
摘要:
转自风雪飘殇博客 自己验证实现并整理,对列表和字典排序时lambda的用法。 函数介绍 sorted() sorted函数: sorted(iterable[,key][,reverse]) 函数接收三个参数:排序的变量、排序的规则、升降序选择 lambda lambda 匿名函数一般形式 def
阅读全文
posted @ 2020-03-09 11:14
共感的艺术
阅读(861)
推荐(0)
编辑
摘要:
python中对于抓取的数据进行排序: def checkstr(mystr): try: num=eval(mystr) return True except: return False filepath=r'D:\python爬虫视频\爬虫代码\处理爬虫数据排序\nasa.txt' readfi
阅读全文
posted @ 2020-03-09 11:09
共感的艺术
阅读(380)
推荐(0)
编辑