码迷,mamicode.com
首页 > 其他好文 > 详细

numpy-转换维度

时间:2018-11-12 19:59:38      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:sha   res   pre   转换   nump   维度   .sh   shape   out   

x=np.array([[[1],[2]],[[3],[4]]]) x.shape Out[109]: (2, 2, 1) x.reshape(2,2) Out[110]: array([[1, 2], [3, 4]]) x Out[111]: array([[[1], [2]], [[3], [4]]]) y=x.reshape(2,2) y Out[113]: array([[1, 2], [3, 4]]) y.reshape(2,2,1) Out[114]: array([[[1], [2]], [[3], [4]]])

numpy-转换维度

标签:sha   res   pre   转换   nump   维度   .sh   shape   out   

原文地址:http://blog.51cto.com/13959448/2316000

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!