메모리 맵은 스코프를 벗어나서 메모리가 회수되면 디스크에 변경 사항이 기록된다. 기존의 메
모리 맵 파일을 열 때 메타데이터 없이 디스크에 저장된 이진 데이터 파일처럼
dtype
과 모양을
지정할 수 있다.
In
[
221
]:
mmap
=
np
.
memmap
('
mymmap
',
dtype
=
'
float64
',
shape
=
(
10000
,
10000
))
In
[
222
]:
mmap
Out
[
222
]:
memmap
([[
0
.
7584
,
-
0
.
6605
,
0
.
8626
,
...,
0
.
6046
,
-
0
.
6212
,
2
.
0542
],
[
-
1
.
2113
,
-
1
.
0375
,
0
.
7093
,
...,
-
1
.
4117
,
-
0
.
1719
,
-
0
.
8957
],
[
-
0
.
1419
,
-
0
.
3375
,
0
.
4329
,
...,
1
.
2914
,
-
0
.
752
,
-
0
.
44
],
...,
[
0
.
,
0
.
,
0
.
,
...,
0
.
,
0
.
,
0
.
],
[
0
.
,
0
.
,
0
.
,
...,
0
.
,
0
.
,
0
.
],
[
0
.
,
0
.
,
0
.
,
...,
0
.
,
0
.
,
0
.
]])
메모리 맵은 디스크상의
ndarray
이므로 위에서 설명한 것처럼 구조화된
dtype
을 사용하는 데
도 아무런 문제가 없다.
A.8.2
HDF5
및 기타 배열 저장 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.