使用astype將np.array轉換爲uint8時,數組元素的類型不會更改。 >>> x = np.array([[1.0, 2.3], [1.3, 2.9]]) >>> x.astype(uint8) array([[1, 2], [1, 2]], ...
確定! 回上一頁