11 2020 档案

摘要:import numpy as np from scipy.optimize import curve_fit #创建函数f(x) = ax + b def func(x,a,b): return a*x+b #创建干净数据 x = np.linspace(0,10,100) y = func(x, 阅读全文
posted @ 2020-11-22 22:35 派大星特烦 阅读(70) 评论(0) 推荐(0)
摘要:from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt from matplotlib import cm fig = plt.figure() ax = fig.gca(projection='3d') X, 阅读全文
posted @ 2020-11-22 22:25 派大星特烦 阅读(97) 评论(0) 推荐(0)
摘要:import numpy as np a = np.arange(9, dtype = np.float_).reshape(3,3) print ('第一个数组:') print (a) print ('\n') print ('第二个数组:') b = np.array([10,10,10]) 阅读全文
posted @ 2020-11-22 22:24 派大星特烦 阅读(75) 评论(0) 推荐(0)
摘要:from random import random def printInfo(): print("这个程序模拟两个选手A和B的乒乓比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") def getInputs(): a = eval(input("请输入选手A的能力值 阅读全文
posted @ 2020-11-22 20:13 派大星特烦 阅读(120) 评论(0) 推荐(0)
摘要:import jieba txt = open("西游记.txt", "r", encoding='utf-8').read() words = jieba.lcut(txt) # 使用精确模式对文本进行分词 counts = {} # 通过键值对的形式存储词语及其出现的次数 for word in 阅读全文
posted @ 2020-11-15 11:21 派大星特烦 阅读(118) 评论(0) 推荐(0)
摘要:import jieba excludes = {"什么","一个","我们","那里","你们","如今","说道","知道","起来","姑娘","这里","出来","他们","众人","自己", "一面","只见","怎么",&quo 阅读全文
posted @ 2020-11-15 11:03 派大星特烦 阅读(121) 评论(0) 推荐(0)
摘要:#第1种 print("小明,10岁,男,上山去砍柴") print("小明,10岁,男,开车去东北") print("小明,10岁,男,最爱打游戏") print("\n") print("老李,90岁,男,上山去砍柴") print("老李,90岁,男,开车去东北") print("老李,90岁 阅读全文
posted @ 2020-11-01 11:04 派大星特烦 阅读(74) 评论(0) 推荐(0)