• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






Hayhong123

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 2

2020年5月6日

Python Numpy 和 Matplotlib 的学习笔记
摘要: numpy 库概述 由于numpy 库中函数较多且命名容易与常用命名混淆,建议采用如下方式引用numpy 库: >>>import numpy as np 其中,as 保留字与import 一起使用能够改变后续代码中库的命名空间,有助于提高代码可读性。简单说,在程序的后续部分中,np 代替numpy 阅读全文
posted @ 2020-05-06 16:22 Hayhong123 阅读(407) 评论(0) 推荐(0)
 

2020年4月23日

Python 体模拟育比赛(排球)
摘要: import random def printIntro(): print("2019310143145") print("模拟排球比赛") print("五局三胜制") print("程序运行需要ABCD的能力值(以0到1之间的小数表示)") def getInputs(): a = eval(i 阅读全文
posted @ 2020-04-23 20:21 Hayhong123 阅读(304) 评论(0) 推荐(0)
 

2020年4月20日

PIL库轮廓提取
摘要: from PIL import Image from PIL import ImageFilter #引用 im = Image.open("D:\\1.jpg") #打开图片,输入图片的地址、名字 om = im.filter(ImageFilter.CONTOUR) #提取轮廓 om.save( 阅读全文
posted @ 2020-04-20 20:35 Hayhong123 阅读(1187) 评论(0) 推荐(0)
 

2020年4月14日

词云
摘要: 例一:制作三国演义的词云 wordcloud import WordCloud import matplotlib.pyplot as plt import jieba # 生成词云 def create_word_cloud(filename): text = open("{}.txt".form 阅读全文
posted @ 2020-04-14 14:26 Hayhong123 阅读(236) 评论(0) 推荐(0)
 

2020年4月13日

运用结巴库分析三国演义的人物出场次数
摘要: import jieba txt = open("D:\\三国演义.txt", "r", encoding='ANSI').read() words = jieba.lcut(txt) # 使用精确模式对文本进行分词 counts = {} # 通过键值对的形式存储词语及其出现的次数 for wor 阅读全文
posted @ 2020-04-13 16:25 Hayhong123 阅读(586) 评论(0) 推荐(0)
 

2020年4月7日

汉诺塔问题
摘要: n=input("输入汉诺塔碟子总数") def move(n,a,b,c): if n==1: print(a,'->',c) else: move(n-1,a,c,b) move(1,a,b,c) move(n-1,b,a,c) 阅读全文
posted @ 2020-04-07 11:32 Hayhong123 阅读(85) 评论(0) 推荐(0)
 

2020年3月15日

六角形绘制
摘要: import turtle turtle.setup(700,700,100,50) #设置画布 turtle.penup() #调整下笔位置turtle.seth(90) turtle.fd(200)turtle.seth(180)turtle.fd(100)turtle.pendown()tur 阅读全文
posted @ 2020-03-15 17:58 Hayhong123 阅读(185) 评论(0) 推荐(0)
 
五角星绘制
摘要: import turtle turtle.setup(700,700,100,50) #设置画布 turtle.seth(90) #调整下笔位置turtle.penup()turtle.fd(200)turtle.pendown()turtle.pensize(10) #设置画笔大小turtle.f 阅读全文
posted @ 2020-03-15 17:37 Hayhong123 阅读(216) 评论(0) 推荐(0)
 
叠加等边三角形绘制
摘要: import turtleturtle.setup(700,700,100,50) #设置画布 turtle.seth(90) #调整下笔位置turtle.penup()turtle.fd(200)turtle.pendown()turtle.pensize(10) #设置画笔大小 #大三角turt 阅读全文
posted @ 2020-03-15 17:14 Hayhong123 阅读(784) 评论(0) 推荐(0)
 
上一页 1 2