역순으로해야합니다.
In [4]: DataFrame(randn(1000000,20)).to_csv('test.csv')
In [5]: !ls -ltr test.csv
-rw-rw-r-- 1 users 399508276 Aug 6 16:55 test.csv
기술적으로 메모리는 이것에 관한 것입니다 (인덱스 포함)
In [16]: df.values.nbytes + df.index.nbytes + df.columns.nbytes
Out[16]: 168000160
따라서 메모리에 168MB, 400MB 파일, 1M 행, 20 개의 부동 열
DataFrame(randn(1000000,20)).to_hdf('test.h5','df')
!ls -ltr test.h5
-rw-rw-r-- 1 users 168073944 Aug 6 16:57 test.h5
바이너리 HDF5 파일로 작성할 때 훨씬 더 압축
In [12]: DataFrame(randn(1000000,20)).to_hdf('test.h5','df',complevel=9,complib='blosc')
In [13]: !ls -ltr test.h5
-rw-rw-r-- 1 users 154727012 Aug 6 16:58 test.h5
데이터가 임의적이기 때문에 압축이별로 도움이되지 않습니다.
top하고Shift + M내 메모리 사용량을 정렬합니다.