Numpy是Python 的库,提供了大量,多维陈列与矩阵,以及其上操作的数据学函数。
如何使用Kaggle
- Go to www.kaggle.com
- Sign Up/Login to your account.
- Click on the notebook from the menu on the left side.
- Click on the New Notebook button to create a notebook
NumPy
import numpy as np
import sys
Python 列表上 的常规NumPy处理
NumPy的矩阵比Python list要紧密,Python列表占20MB,然后用Numpy(a NumPy array wtih single-precision floats in the cells)只要4M。如下:
import numpy as np
import sys
py_array=[1,2,3,4,5,6]
numpy_array=np.array([1,2,3,4,5,6])
sizeof_py_arr=sys.getsizeof(1)*