1. 程式人生 > >numpy中numpy.ndarray型別學習

numpy中numpy.ndarray型別學習

能生成numpy.ndarray型別的方法有:


  • np.arange( left,right,stride )
  • np.array(array or any nested sequence)
  • np.linspace( start,stop,num )
  • np.ones( tuple )
  • np.zeros( tuple )

numpy.ndarray物件的運算


  • 可以np.dot()
  • 數乘:k*np.ndarray

np.resize() &np.reshape()


resize改變自身的形狀,reshape不改變自身的形狀,返回一個改變形態的替身。