numpy array
파이썬의 list 보다 np array가
- 더 빠르다
- element로 PyObject 대신 value를 들고 있어 직접 접근할 수 있다.
- 메모리 효율이 좋다.
- element의 크기가 작다
-
- PyObject - 4 for type pointer, 4 for reference count, 4 for value – and the memory allocators rounds up to 16
- value - single-precision numbers takes 4 bytes each, double-precision ones, 8 bytes
-
- 동적배열 아니어서 크기가 고정이며
- 정적할당하여 element 타입이 고정이다
- element의 크기가 작다