摘要: import numpy as npimport pandas as pdinputfile = 'D:/xuexi/Anaconda/data/data.csv'data = pd.read_csv(inputfile) description = [data.min(), data.max(), 阅读全文
posted @ 2023-03-05 19:18 tan45 阅读(27) 评论(0) 推荐(0)
摘要: 箱型图 import pandas as pdcatering_sale = 'D:/xuexi/anaconda/data/catering_sale.xls' # 餐饮数据data = pd.read_excel(catering_sale, index_col = u'日期') # 读取数据, 阅读全文
posted @ 2023-02-26 16:52 tan45 阅读(26) 评论(0) 推荐(0)
摘要: torch 神经网络例子: import torchimport torch.nn as nnimport torch.nn.functional as F class Net(nn.Module): def __init__(self):super(Net, self).__init__()# 1 阅读全文
posted @ 2022-05-16 17:29 tan45 阅读(53) 评论(0) 推荐(0)
摘要: 到目前为止,Keras已经与TensorFlow完全整合。Keras团队不再更新或维护Keras的独立版本。所以现在所讨论的Keras,是一个集成在Tensor Flow中的API,而不是一个单独的独立库。 TensorFlow 用图来表示计算任务,图中的节点被称之为operation,缩写成op。 阅读全文
posted @ 2022-04-25 17:33 tan45 阅读(29) 评论(0) 推荐(0)
摘要: import pandas as pd import numpy as np import matplotlib.pyplot as plt def sigmoid(x): # 定义网络激活函数 return 1/(1+np.exp(-x)) data_tr = pd.read_csv(r'E:\1 阅读全文
posted @ 2022-03-18 17:20 tan45 阅读(16) 评论(0) 推荐(0)
摘要: money_all=56.75+72.91+88.50+26.37+68.51money_all_str=str(money_all)print("商品总金额为:"+money_all_str)money_real=int(money_all)money_real_str=str(money_rea 阅读全文
posted @ 2021-09-13 21:47 tan45 阅读(28) 评论(0) 推荐(0)
摘要: def happy(n): try: if n==1: print("True") else: new=str(n) sum=0 for c in new: sum+=int(c)**2 return happy(sum) except Exception as e: print ("False") 阅读全文
posted @ 2021-09-13 21:05 tan45 阅读(105) 评论(0) 推荐(0)
摘要: n=eval(input("请输入一个整数:"))N=abs(n)a=N+10b=N-10c=N*10if n>0: a=abs(a) b=abs(b) c=abs(c)else: a=-abs(a) b=-abs(b) c=-abs(c)print(N,a,b,c,end="") 阅读全文
posted @ 2021-09-13 20:54 tan45 阅读(96) 评论(0) 推荐(0)
摘要: a=input("请输入字符串:")result=a[::-1]print("该字符串的倒序为:",result) 阅读全文
posted @ 2021-09-13 20:38 tan45 阅读(47) 评论(0) 推荐(0)
摘要: n=int(input())sum=1for i in range(1,n+1): sum=sum*iprint(sum) 阅读全文
posted @ 2021-09-12 22:07 tan45 阅读(38) 评论(0) 推荐(0)