CV算法數據清洗,手模手教學,numpy、pandas、matplotlib

CV算法工作流,無外乎就是,從圖像數據標籤數據,到圖像數據標籤數據, 的輸入輸出過程。過程中間就是各個模型算法的學習處理,數據的處理清洗是算法效果的根基。數據清洗裏有三個重要基礎知識,numpy、pandas、matplotlib

 

生成numpy數組

1.1 生成0和1的數組

  • np.ones(shape[, dtype, order])
  • np.ones_like(a[, dtype, order, subok])
  • np.zeros(shape[, dtype, order])
  • np.zeros_like(a[, dtype, order, subok])
>>> zero = np.zeros([3, 4])
array([[ 0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.]])

1.2 從現有數組生成

1.2.1 生成方式

  • np.array(object[, dtype, copy, order, subok, ndmin])

  • np.asarray(a[, dtype, order])

a = np.array([[1,2,3],[4,5,6]])
# 從現有的數組當中創建
a1 = np.array(a)
# 相當於索引的形式,並沒有真正的創建一個新的
a2 = np.asarray(a)

 

1.3 生成固定範圍的數組

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章