1. The difference between numpy structured array and Pandas Dataframe:
we make use of a data format that consists of a set of numpy structured arrays. Conceptually, it is similar to a set of CSV files with records and different columns, only that they are stored as binary files instead of text. Structured arrays can be directly memory mapped from disk.
- 原来都是为了速度!
- 使用dtype创建结构性数组
官方文档 1
data = np.zeros(3,dtype=[('color', int8, (3,),),('age',int64)]
data = np.zeros(3, dtype = '3int8,int64)
2. 为什么有的方法后面有括号,有的没有? 比如 ndarray类:
nda.flat , nda.ravel() 都返回一个flattened的ndarray
https://docs.scipy.org/doc/numpy-1.13.0/user/basics.rec.html ↩︎