尘风
红尘往事,一切随风
摘要: <!DOCTYPE html><html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title></title> <style> .left div, .right div { wid 阅读全文
posted @ 2020-09-07 23:46 一个行者 阅读(1401) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title></title> <script src="https://www.imooc.com/ 阅读全文
posted @ 2020-09-07 23:44 一个行者 阅读(338) 评论(0) 推荐(0) 编辑
摘要: import random a=random.randint(1,10) b=0 num=3 while num>0: print("你还有"+str(num)+"次机会") num-=1 b=int(input("请输入数字:")) if num==0 or b==a: print("你猜对了!" 阅读全文
posted @ 2020-09-07 23:39 一个行者 阅读(241) 评论(0) 推荐(0) 编辑
摘要: a=["blue","red","brack"] print(len(a))#列表长度 a.append("yellow") print(a) b=sorted(a)#排序,升序,不改变原列表 print(b) a.sort()#排序,升序,改变原列表 print(a) a.pop(3)#删除,根据 阅读全文
posted @ 2020-09-07 23:38 一个行者 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 转化int: 不转int: 1.matplotlib.pyplot as plt 画图库 2.plt.show() 查看图像 3.plt.plot(x,y,c,linewidth=10) x,y分别是图像坐标轴,linewidth设置折线图线的粗细,c设置线条颜色 4.plt.scatter(x,y 阅读全文
posted @ 2020-09-07 23:36 一个行者 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 代码: try: from urllib2 import urlopen except ImportError: from urllib.request import urlopen import json #导入json,读取json文件 from matplotlib import pyplot 阅读全文
posted @ 2020-09-07 23:31 一个行者 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 代码实现: import csv from matplotlib import pyplot as plt from datetime import datetime date=[] airmax=[] airmin=[] with open(r'C:\Users\Administrator\Des 阅读全文
posted @ 2020-09-07 23:28 一个行者 阅读(1278) 评论(0) 推荐(0) 编辑
摘要: 代码: import csv from matplotlib import pyplot as plt arr=[] arrmin=[] date=[] with open(r'C:\Users\Administrator\Desktop\新建文本文档 (3).csv') as cs: read=c 阅读全文
posted @ 2020-09-07 23:27 一个行者 阅读(1318) 评论(0) 推荐(0) 编辑
摘要: randomwalk.py代码 from random import choice class RandomWalk(): def __init__(self,points=5000): self.points=points self.x=[0] self.y=[0] def random_walk 阅读全文
posted @ 2020-09-07 23:25 一个行者 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 方法和画折线图类似,差别在于画图函数不一样,用的是scatter() import matplotlib.pyplot as plt #以外部两个txt表分别作为x,y画图n=0m=0with open(r'C:\Users\Administrator\Desktop\test.txt') as t 阅读全文
posted @ 2020-09-07 23:17 一个行者 阅读(951) 评论(0) 推荐(0) 编辑