摘要: 1 # 多行写入 2 nums = ['one','two','three','four','five','six','seven'] 3 t = open(r'd:\python_fileprocess\t2.txt','a') 4 for get_one in nums: 5 t.write(g 阅读全文
posted @ 2020-05-22 15:32 小他_W 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 1 newfile = r'd:\python_fileprocess\t1.txt' # 定义需要建立的文本名称和路径 2 b_new_file = open(newfile,'w') # open函数建立一个新的文本文件 3 t_n = b_new_file.write('monster') # 阅读全文
posted @ 2020-05-22 15:16 小他_W 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 1 import matplotlib.pyplot as plt 2 import numpy as np 3 # 生成x数据 4 x = np.linspace(-10,10,100) 5 y = np.tanh(x) 6 plt.plot(x,y) 7 plt.show() 阅读全文
posted @ 2020-05-22 11:38 小他_W 阅读(1239) 评论(0) 推荐(0) 编辑
摘要: 1 import numpy as np 2 import matplotlib.pyplot as plt 3 def sigmoid(x): 4 return 1.0/(1+np.exp(-x)) 5 x = np.arange(-10,10,step = 1)# 生成一个numpy数组 6 f 阅读全文
posted @ 2020-05-22 11:21 小他_W 阅读(249) 评论(0) 推荐(0) 编辑