摘要: 一、BP神经网络算法 import pandas as pd import numpy as np #导入划分数据集函数 from sklearn.model_selection import train_test_split #读取数据 datafile = 'C:/Users/Desktop/8 阅读全文
posted @ 2022-03-29 17:02 zzh007 阅读(130) 评论(0) 推荐(0) 编辑
摘要: import requests from bs4 import BeautifulSoup import csv import pandas as pd allUniv=[] def getHTMLText(url): try: r=requests.get(url,timeout=30) r.ra 阅读全文
posted @ 2020-05-13 15:47 zzh007 阅读(97) 评论(0) 推荐(0) 编辑
摘要: from PIL import Image import numpy as np a = np.asarray(Image.open('‪D:/anaconda/learning note/7e5829bdcefae7d1.jpg').convert('L')).astype('float') de 阅读全文
posted @ 2020-05-06 15:27 zzh007 阅读(136) 评论(0) 推荐(0) 编辑
摘要: import random def printIntro(): print("moniA and B") def getInputs(): a = eval(input("please input A socre(0~1):")) b = eval(input("please input B soc 阅读全文
posted @ 2020-04-21 13:18 zzh007 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 1 n=input("输入汉诺塔碟子总数") 2 def move(n,a,b,c): 3 if n==1: 4 print(a,'->',c) 5 else: 6 move(n-1,a,c,b) 7 move(1,a,b,c) 8 move(n-1,b,a,c) 9 10 动图: 11 impor 阅读全文
posted @ 2020-03-31 17:34 zzh007 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Turtle库是Python语言中一个很流行的绘制图像的函数库,想象一个小乌龟,在一个横轴为x、纵轴为y的坐标系原点,(0,0)位置开始,它根据一组函数指令的控制,在这个平面坐标系中移动,从而在它爬行的路径上绘制了图形。 turtle绘图的基础知识:1. 画布(canvas) 画布就是turtle为 阅读全文
posted @ 2020-03-23 22:10 zzh007 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1 import time 2 scale=50 3 print("执行开始".center(scale//2,"-")) 4 start=time.perf_counter() 5 for i in range(scale+1): 6 a='*' *i 7 b='·' *(scale-i) 8 c 阅读全文
posted @ 2020-03-22 21:46 zzh007 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 1 ss = input() 2 t = "" 3 for i in ss: 4 if 'a' <= i <= 'z': 5 t += chr( ord('a') + ((ord(c)-ord('a')) + 3 )%26 ) 6 elif 'A'<=c<='Z': 7 t += chr( ord( 阅读全文
posted @ 2020-03-22 13:29 zzh007 阅读(207) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.color("red") turtle.pencolor("black") turtle.penup turtle.fd(-100) turtle.pendown turtle.begin_fill() for i in range(5): turtle.f 阅读全文
posted @ 2020-03-11 23:30 zzh007 阅读(76) 评论(0) 推荐(0) 编辑
摘要: import turtle as t t.penup() t.fd(-100) t.pendown() t.seth(30) for i in range(3): t.fd(120) t.right(120) t.fd(40) t.left(60) t.fd(40) t.seth(-30) for 阅读全文
posted @ 2020-03-11 23:30 zzh007 阅读(93) 评论(0) 推荐(0) 编辑