摘要: for i in range(1,10,2): print(i) 隔两个 阅读全文
posted @ 2020-12-26 19:55 bH1pJ 阅读(337) 评论(0) 推荐(0) 编辑
摘要: np.hstack & np.vstack np.Repeat() ra2 = np.repeat(array,1,10) repmat 阅读全文
posted @ 2020-12-26 19:28 bH1pJ 阅读(14) 评论(0) 推荐(0) 编辑
摘要: np.hstack & np.vstack np.Repeat() ra2 = np.repeat(array,1,10) repmat 阅读全文
posted @ 2020-12-26 19:29 bH1pJ 阅读(65) 评论(0) 推荐(0) 编辑
摘要: m,n=100,3 import numpy as np array = np.ones((m,n)) array = np.zeros((m,n)) 阅读全文
posted @ 2020-12-26 19:06 bH1pJ 阅读(107) 评论(0) 推荐(0) 编辑
摘要: pickle # 存储变量的文件的名字filename = 'Day3-Data.data'if os.path.exists(filename): print("Already exist") with open(filename, 'r... 阅读全文
posted @ 2020-12-26 19:06 bH1pJ 阅读(41) 评论(0) 推荐(0) 编辑
摘要: import os os.path.exists os.path.exists(filename) 阅读全文
posted @ 2020-12-26 18:45 bH1pJ 阅读(11) 评论(0) 推荐(0) 编辑
摘要: python如何保存变量 https://blog.csdn.net/jining11/article/details/81435899 filename = 'shoplist.data'# 以二进制写模式打开目标文件f = open(filen... 阅读全文
posted @ 2020-12-26 17:31 bH1pJ 阅读(190) 评论(0) 推荐(0) 编辑
摘要: len(re.findall(value,password)) 或者用“”.count() print(a.count(b)) #2 阅读全文
posted @ 2020-12-26 17:06 bH1pJ 阅读(33) 评论(0) 推荐(0) 编辑
摘要: import requests#通过url获取数据def get_page(url): #requests.get 自带 json.load page = requests.get(url) page = page.content #将... 阅读全文
posted @ 2020-12-26 13:41 bH1pJ 阅读(398) 评论(0) 推荐(0) 编辑
摘要: python 求两个list的交集 r = list(set(data2).intersection(set(data)))print(r[0]*r[1]) 阅读全文
posted @ 2020-12-26 13:10 bH1pJ 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 写个for循环吧 data2= []for i in data: data2.append(i-10) 阅读全文
posted @ 2020-12-26 12:59 bH1pJ 阅读(460) 评论(0) 推荐(0) 编辑