上一页 1 ··· 147 148 149 150 151 152 153 154 155 ··· 178 下一页
  2019年8月28日
摘要: """ 1.当原始数组A[4,6]为二维数组,代表4行6列。 A.reshape(-1,8):表示将数组转换成8列的数组,具体多少行我们不知道,所以参数设为-1。用我们的数学可以计算出是3行8列 2当原始数组A[4,6]为二维数组,代表4行6列。 A.reshape(3,-1):表示将数组转换成3行 阅读全文
posted @ 2019-08-28 09:26 一杯明月 阅读(18545) 评论(0) 推荐(0)
摘要: 来源:http://c.biancheng.net/view/2175.html 阅读全文
posted @ 2019-08-28 09:00 一杯明月 阅读(1929) 评论(0) 推荐(0)
  2019年8月27日
摘要: python assert的作用:assert函数用于程序调试Python 官方文档解释https://docs.python.org/3/reference/simple_stmts.html#assert “Assert statements are a convenient way to in 阅读全文
posted @ 2019-08-27 08:59 一杯明月 阅读(1918) 评论(0) 推荐(0)
  2019年8月26日
摘要: from keras.utils.np_utils import * # 类别向量定义 b = [0, 1, 2, 3, 4, 5, 6, 7, 8] # 调用to_categorical将b按照9个类别来进行转换 b = to_categorical(b, 9) print(b) 来源:https 阅读全文
posted @ 2019-08-26 23:10 一杯明月 阅读(5790) 评论(0) 推荐(0)
摘要: img = np.array(im) R,G,B=im.split() r=np.array(R) g=np.array(G) b=np.array(B) print(r[0]) print(g[0]) print(b[0]) print(im.getpixel((0,0))) 阅读全文
posted @ 2019-08-26 20:18 一杯明月 阅读(801) 评论(0) 推荐(0)
摘要: 1. 数组的操作: import numpy as np a = np.array([[1, 2], [3, 4]]) print(a) print(type(a)) print(np.mean(a)) print(np.mean(a, axis=0)) # axis=0,计算每一列的均值 prin 阅读全文
posted @ 2019-08-26 16:25 一杯明月 阅读(29831) 评论(0) 推荐(0)
摘要: import numpy as np from PIL import Image import pickle import os CHANNEL = 3 WIDTH = 32 HEIGHT = 32 data = [] labels=[] classification = ['airplane','automobile','bird','cat','deer','dog','frog... 阅读全文
posted @ 2019-08-26 13:34 一杯明月 阅读(1224) 评论(0) 推荐(0)
  2019年8月20日
摘要: 格式说明由%和格式字符组成,如%f,它的作用是将数据按照指定的格式输出。格式说明是由“%”字符开始的。 1.整型输出%d print 'my age is %d'% (26) 说明:%d相当于是一个占位符号,下同。 2.输出字符串%s print 'my name is %s' % ('xiaomi 阅读全文
posted @ 2019-08-20 19:37 一杯明月 阅读(2581) 评论(0) 推荐(0)
摘要: 1,GitHub 中可以直接打开 .ipynb 文件。 2,可以把 .ipynb 文件对应的下载链接复制到 https://nbviewer.jupyter.org/ 中查看。 阅读全文
posted @ 2019-08-20 13:56 一杯明月 阅读(3907) 评论(0) 推荐(0)
  2019年8月17日
摘要: 阅读全文
posted @ 2019-08-17 10:12 一杯明月 阅读(5073) 评论(0) 推荐(0)
上一页 1 ··· 147 148 149 150 151 152 153 154 155 ··· 178 下一页