摘要: cm_plot 函数代码 def cm_plot(y, yp): from sklearn.metrics import confusion_matrix #µ¼Èë»ìÏý¾ØÕóº¯Êý cm = confusion_matrix(y, yp) #»ìÏý¾ØÕó import matplotl 阅读全文
posted @ 2022-03-28 08:49 Lysim 阅读(78) 评论(0) 推荐(0)
摘要: # -*- coding: utf-8 -*- """ Created on Sat Sep 11 08:47:35 2021 @author: Lysim """ import random from fractions import Fraction #主干函数 def main(): prin 阅读全文
posted @ 2021-09-18 13:20 Lysim 阅读(63) 评论(0) 推荐(0)
摘要: 1.文件读写的读书笔记 文件的打开关闭 a.read(size) 读入前size长度 a.readline(size) 读入该行前size长度 a.readlines(hint) 读入前hint行 打开:<变量名>=open(<文件名>,<打开模式>) 打开模式 含义 'r' 只读模式,如果文件不存 阅读全文
posted @ 2020-05-27 09:48 Lysim 阅读(81) 评论(0) 推荐(0)
摘要: import requestsfor i in range(20): r=requests.get('http://www.baidu.com')print(r.status_code)print(r.text)print(type(r.text))print(len(r.content)) 阅读全文
posted @ 2020-05-13 21:43 Lysim 阅读(208) 评论(0) 推荐(0)
摘要: from random import randomdef printIntro(): print("这个程序模拟两个选手A和B的某种竞技比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)")def getInputs(): a=eval(input("请输入选手A的能力值( 阅读全文
posted @ 2020-05-13 16:13 Lysim 阅读(80) 评论(0) 推荐(0)
摘要: import requestsfrom bs4 import BeautifulSoupallU=[]def getHTMLText(ur1): try: r=requests.get(ur1,timeout=30) r.raise_for_status() r.encoding='utf-8' r 阅读全文
posted @ 2020-05-13 15:59 Lysim 阅读(127) 评论(0) 推荐(0)
摘要: #numpy matplotlib读书笔记 import numpy as np import matplotlib.pyplot as pt x = np.arange(0 , 360) y = np.arctan( x * np.pi / 180.0) pt.plot(x,y) pt.xlim( 阅读全文
posted @ 2020-04-30 16:30 Lysim 阅读(199) 评论(0) 推荐(0)
摘要: from random import randomdef printIntro(): print("这个程序模拟两个选手A和B的某种竞技比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)")def getInputs(): a=eval(input("请输入选手A的能力值( 阅读全文
posted @ 2020-04-15 21:35 Lysim 阅读(170) 评论(0) 推荐(0)
摘要: from PIL import Imagefrom PIL import ImageEnhanceimport cv2import numpy as np # image = Image.open('14.jpg')#image.show()def BrightnessEnhancement(bri 阅读全文
posted @ 2020-04-12 14:05 Lysim 阅读(207) 评论(0) 推荐(0)
摘要: import jiebaimport wordcloudf=open("许一人偏爱.txt","r",encoding='utf-8')t=f.read()f.close()ls=jieba.lcut(t)txt=" ".join(ls)w=wordcloud.WordCloud(font_path 阅读全文
posted @ 2020-04-07 19:31 Lysim 阅读(158) 评论(0) 推荐(0)