hyb
2026-01-09 4cb426cb3ae31e772a09d4ade5b2f0242aaeefa0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
Ë
Kñúh ”ãóT—dZddlZddlZddlZddlZddlZddlmZddlm    Z    gZ
de    _ hd£Z dZ ee «dzZd    Zd
Zd Zd d ddœZdZd„Zed«d„«Zed«d„«Zed«d„«Zed«d„«Zed«d„«Zd„Zd„Zd&d„Zed«d„«Zed«d„«Zed«efd„«Z ed«efd„«Z!d„Z"efd„Z#ed«d'd „«Z$ed«d(ed!œd"„«Z%ed«        d)ed!œd#„«Z&d*d$„Z'ed«d%„«Z(y)+aþ
Binary serialization
 
NPY format
==========
 
A simple format for saving numpy arrays to disk with the full
information about them.
 
The ``.npy`` format is the standard binary file format in NumPy for
persisting a *single* arbitrary NumPy array on disk. The format stores all
of the shape and dtype information necessary to reconstruct the array
correctly even on another machine with a different architecture.
The format is designed to be as simple as possible while achieving
its limited goals.
 
The ``.npz`` format is the standard format for persisting *multiple* NumPy
arrays on disk. A ``.npz`` file is a zip file containing multiple ``.npy``
files, one for each array.
 
Capabilities
------------
 
- Can represent all NumPy arrays including nested record arrays and
  object arrays.
 
- Represents the data in its native binary form.
 
- Supports Fortran-contiguous arrays directly.
 
- Stores all of the necessary information to reconstruct the array
  including shape and dtype on a machine of a different
  architecture.  Both little-endian and big-endian arrays are
  supported, and a file with little-endian numbers will yield
  a little-endian array on any machine reading the file. The
  types are described in terms of their actual sizes. For example,
  if a machine with a 64-bit C "long int" writes out an array with
  "long ints", a reading machine with 32-bit C "long ints" will yield
  an array with 64-bit integers.
 
- Is straightforward to reverse engineer. Datasets often live longer than
  the programs that created them. A competent developer should be
  able to create a solution in their preferred programming language to
  read most ``.npy`` files that they have been given without much
  documentation.
 
- Allows memory-mapping of the data. See `open_memmap`.
 
- Can be read from a filelike stream object instead of an actual file.
 
- Stores object arrays, i.e. arrays containing elements that are arbitrary
  Python objects. Files with object arrays are not to be mmapable, but
  can be read and written to disk.
 
Limitations
-----------
 
- Arbitrary subclasses of numpy.ndarray are not completely preserved.
  Subclasses will be accepted for writing, but only the array data will
  be written out. A regular numpy.ndarray object will be created
  upon reading the file.
 
.. warning::
 
  Due to limitations in the interpretation of structured dtypes, dtypes
  with fields with empty names will have the names replaced by 'f0', 'f1',
  etc. Such arrays will not round-trip through the format entirely
  accurately. The data is intact; only the field names will differ. We are
  working on a fix for this. This fix will not require a change in the
  file format. The arrays with such structures can still be saved and
  restored, and the correct dtype may be restored by using the
  ``loadedarray.view(correct_dtype)`` method.
 
File extensions
---------------
 
We recommend using the ``.npy`` and ``.npz`` extensions for files saved
in this format. This is by no means a requirement; applications may wish
to use these file formats but use an extension specific to the
application. In the absence of an obvious alternative, however,
we suggest using ``.npy`` and ``.npz``.
 
Version numbering
-----------------
 
The version numbering of these formats is independent of NumPy version
numbering. If the format is upgraded, the code in `numpy.io` will still
be able to read and write Version 1.0 files.
 
Format Version 1.0
------------------
 
The first 6 bytes are a magic string: exactly ``\x93NUMPY``.
 
The next 1 byte is an unsigned byte: the major version number of the file
format, e.g. ``\x01``.
 
The next 1 byte is an unsigned byte: the minor version number of the file
format, e.g. ``\x00``. Note: the version of the file format is not tied
to the version of the numpy package.
 
The next 2 bytes form a little-endian unsigned short int: the length of
the header data HEADER_LEN.
 
The next HEADER_LEN bytes form the header data describing the array's
format. It is an ASCII string which contains a Python literal expression
of a dictionary. It is terminated by a newline (``\n``) and padded with
spaces (``\x20``) to make the total of
``len(magic string) + 2 + len(length) + HEADER_LEN`` be evenly divisible
by 64 for alignment purposes.
 
The dictionary contains three keys:
 
    "descr" : dtype.descr
      An object that can be passed as an argument to the `numpy.dtype`
      constructor to create the array's dtype.
    "fortran_order" : bool
      Whether the array data is Fortran-contiguous or not. Since
      Fortran-contiguous arrays are a common form of non-C-contiguity,
      we allow them to be written directly to disk for efficiency.
    "shape" : tuple of int
      The shape of the array.
 
For repeatability and readability, the dictionary keys are sorted in
alphabetic order. This is for convenience only. A writer SHOULD implement
this if possible. A reader MUST NOT depend on this.
 
Following the header comes the array data. If the dtype contains Python
objects (i.e. ``dtype.hasobject is True``), then the data is a Python
pickle of the array. Otherwise the data is the contiguous (either C-
or Fortran-, depending on ``fortran_order``) bytes of the array.
Consumers can figure out the number of bytes by multiplying the number
of elements given by the shape (noting that ``shape=()`` means there is
1 element) by ``dtype.itemsize``.
 
Format Version 2.0
------------------
 
The version 1.0 format only allowed the array header to have a total size of
65535 bytes.  This can be exceeded by structured arrays with a large number of
columns.  The version 2.0 format extends the header size to 4 GiB.
`numpy.save` will automatically save in 2.0 format if the data requires it,
else it will always use the more compatible 1.0 format.
 
The description of the fourth element of the header therefore has become:
"The next 4 bytes form a little-endian unsigned int: the length of the header
data HEADER_LEN."
 
Format Version 3.0
------------------
 
This version replaces the ASCII string (which in practice was latin1) with
a utf8-encoded string, so supports structured types with any unicode field
names.
 
Notes
-----
The ``.npy`` format, including motivation for creating it and a comparison of
alternatives, is described in the
:doc:`"npy-format" NEP <neps:nep-0001-npy-format>`, however details have
evolved with time and this document is more current.
 
éN)Ú
set_module)Ú drop_metadataznumpy.lib.format>ÚdescrÚshapeÚ fortran_orders“NUMPYéé@ié)z<HÚlatin1)ú<Ir )r Úutf8)©ér©rr©éri'có.—|dvrd}t||fz«‚y)N)rrrNz>we only support format version (1,0), (2,0), and (3,0), not %s)Ú
ValueError)ÚversionÚmsgs  úIH:\Change_password\venv_build\Lib\site-packages\numpy/lib/_format_impl.pyÚ_check_versionrÇs'€ØÐ4Ñ4ØNˆÜ˜ ˜zÑ)Ó*Ð*ð5ócó~—|dks|dkDr td«‚|dks|dkDr td«‚tt||g«zS)a
 Return the magic string for the given file format version.
 
    Parameters
    ----------
    major : int in [0, 255]
    minor : int in [0, 255]
 
    Returns
    -------
    magic : str
 
    Raises
    ------
    ValueError if the version cannot be formatted.
    réÿz&major version must be 0 <= major < 256z&minor version must be 0 <= minor < 256)rÚ MAGIC_PREFIXÚbytes)ÚmajorÚminors  rÚmagicr ÍsJ€ð" ˆq‚yE˜C’KÜÐAÓBÐBØ ˆq‚yE˜C’KÜÐAÓBÐBÜ œ% ¨ Ó/Ñ /Ð/rcó†—t|td«}|ddtk7rd}t|t|ddfz«‚|dd\}}||fS)z³ Read the magic string to get the version of the file format.
 
    Parameters
    ----------
    fp : filelike object
 
    Returns
    -------
    major : int
    minor : int
    z magic stringNéþÿÿÿz4the magic string is not correct; expected %r, got %r)Ú _read_bytesÚ    MAGIC_LENrr)ÚfpÚ    magic_strrrrs     rÚ
read_magicr'åsY€ô˜B¤    ¨>Ó:€Iؐ"€~œÒ%ØDˆÜ˜¤ ¨i¸¸¨nÐ=Ñ=Ó>Ð>ؘR˜S>L€Eˆ5Ø %ˆ<Ðrcó—t|«}||urtjdtd¬«|}|j |j
St |«jstjdtd¬«y|jS)a´
    Get a serializable descriptor from the dtype.
 
    The .descr attribute of a dtype object cannot be round-tripped through
    the dtype() constructor. Simple types, like dtype('float32'), have
    a descr which looks like a record array with one field with '' as
    a name. The dtype() constructor interprets this as a request to give
    a default name.  Instead, we construct descriptor that can be passed to
    dtype().
 
    Parameters
    ----------
    dtype : dtype
        The dtype of the array that will be written to disk.
 
    Returns
    -------
    descr : object
        An object that can be passed to `numpy.dtype()` in order to
        replicate the input dtype.
 
    z`metadata on a dtype is not saved to an npy/npz. Use another format (such as pickle) to store it.r©Ú
stacklevelz|Custom dtypes are saved as python objects using the pickle protocol. Loading this file requires allow_pickle=True to be set.z|O)    rÚwarningsÚwarnÚ UserWarningÚnamesrÚtypeÚ_legacyÚstr)ÚdtypeÚ    new_dtypes  rÚdtype_to_descrr4ús€€ô4˜eÓ$€IؘÑ܏ ‰ ðIä!¨aõ    1ð €Eà ‡{{Ðð
{‰{ÐÜ %‹[×  Ò  ô     ‰ ð5ô"¨aõ    1ðày‰yÐrcóà—t|t«rtj|«St|t«r(t |d«}tj||df«Sg}g}g}g}d}|D]è}t |«dk(r|\}}    t |    «}n&|\}}    }
tjt |    «|
f«}|dk(xr,|jtjuxr|jdu} | s]t|t«r|nd|f\} }|j| «|j|«|j|«|j|«||jz }Œêtj|||||dœ«S)a6
    Returns a dtype based off the given description.
 
    This is essentially the reverse of `~lib.format.dtype_to_descr`. It will
    remove the valueless padding fields created by, i.e. simple fields like
    dtype('float32'), and then convert the description to its corresponding
    dtype.
 
    Parameters
    ----------
    descr : object
        The object retrieved by dtype.descr. Can be passed to
        `numpy.dtype` in order to replicate the input dtype.
 
    Returns
    -------
    dtype : dtype
        The dtype constructed by the description.
 
    rrrÚN)r.ÚformatsÚtitlesÚoffsetsÚitemsize) Ú
isinstancer1Únumpyr2ÚtupleÚdescr_to_dtypeÚlenr/Úvoidr.Úappendr:) rÚdtr8r.r7r9ÚoffsetÚfieldÚnameÚ    descr_strrÚis_padÚtitles              rr>r>6s`€ô,%œÔä{‰{˜5Ó!Ð!Ü    Eœ5Ô    !ä ˜E !™HÓ %ˆÜ{‰{˜B  a¡˜>Ó*Ð*à €FØ €EØ€GØ€GØ €FØòˆÜ ˆu‹:˜Š?Ø#‰OˆD)Ü     Ó*‰Bà%*Ñ "ˆD)˜UÜ—‘œn¨YÓ7¸Ð?Ó@ˆBð˜"‘*ÒK §¡¬E¯J©JÐ!6ÒK¸2¿8¹8ÀtÐ;KˆÙÜ",¨T´5Ô"9™$ÀÀd¸|‰KˆE4Ø M‰M˜%Ô  Ø L‰L˜Ô Ø N‰N˜2Ô Ø N‰N˜6Ô "ؐ"—+‘+щð#ô& ;‰; °7ÀfØ#*¸ñ@ó AðArcó̗d|ji}|jjrd|d<n!|jjrd|d<nd|d<t    |j
«|d<|S)a Get the dictionary of header metadata from a numpy.ndarray.
 
    Parameters
    ----------
    array : numpy.ndarray
 
    Returns
    -------
    d : dict
        This has the appropriate entries for writing its string representation
        to the header of the file.
    rFrTr)rÚflagsÚ c_contiguousÚ f_contiguousr4r2)ÚarrayÚds  rÚheader_data_from_array_1_0rOpsc€ð
%—+‘+ЀAØ ‡{{×ÒØ"ˆˆ/ÒØ    ‰×    !Ò    !Ø!ˆˆ/Òð
#ˆˆ/Ñä § ¡ Ó,€A€gJØ €Hrcób—ddl}|€J‚t|\}}|j|«}t|«dz}tt
|j |«z|ztzz
}    t|Ž|j|||z«z}||zd|zzdzS#|j$rd|›d|›}t|«d‚wxYw)zO
    Takes a stringified header, and attaches the prefix and padding to it
    rNrzHeader length z too big for version=ó ó
) ÚstructÚ_header_size_infoÚencoder?Ú ARRAY_ALIGNr$Úcalcsizer ÚpackÚerrorr)    ÚheaderrrSÚfmtÚencodingÚhlenÚpadlenÚ header_prefixrs             rÚ _wrap_headerr`sπóØ Ð ÐÐ Ü% gÑ.M€CˆØ ]‰]˜8Ó $€FÜ ˆv‹;˜‰?€DÜ œY¨¯©¸Ó)=Ñ=ÀÑDÌ ÑSÑ T€Fð(ܘw˜¨&¯+©+°c¸4À&¹=Ó*IÑIˆ ð ˜6Ñ ! D¨6¡MÑ 1°EÑ 9Ð9øð <‰<ò(ؘt˜fÐ$9¸'¸ÐCˆÜ˜‹o 4Ð'ð(ús ÁB
Â
$B.có—    t|d«S#t$rYnwxYw    t|d«}tjdtd¬«|S#t
$rYnwxYwt|d«}tjdtd¬«|S)zT
    Like `_wrap_header`, but chooses an appropriate version given the contents
    rrz>Stored array in format 2.0. It can only beread by NumPy >= 1.9rr)rz@Stored array in format 3.0. It can only be read by NumPy >= 1.17)r`rr+r,r-ÚUnicodeEncodeError)rZÚrets  rÚ_wrap_header_guess_versionrd¥s“€ð ܘF FÓ+Ð+øÜ ò Ù ð úðܘ6 6Ó*ˆô     ‰ ð-Ü.9Àaõ    Iàˆ
øô ò Ù ð úô˜& &Ó )€FÜ ‡MMð*Ü+6À1õFà €Ms‚ Ž    ™ž AÁ    AÁAc
ó¨—dg}t|j««D]&\}}|jd|›dt|«›d«Œ(|jd«dj    |«}|d}|dt |«d    kDr%t t t||d
rd nd    ««z
nd    zz }|€ t|«}n t||«}|j|«y ) aÀ Write the header for an array and returns the version used
 
    Parameters
    ----------
    fp : filelike object
    d : dict
        This has the appropriate entries for writing its string representation
        to the header of the file.
    version : tuple or None
        None means use oldest that works. Providing an explicit version will
        raise a ValueError if the format does not allow saving this data.
        Default: None
    ú{ú'z': z, ú}r6rú rréÿÿÿÿN)
ÚsortedÚitemsrAÚreprÚjoinr?ÚGROWTH_AXIS_MAX_DIGITSrdr`Úwrite)r%rNrrZÚkeyÚvaluers       rÚ_write_array_headerrs½s߀ðˆU€FܘQŸW™W›YÓ'ò3‰
ˆˆUà ‰ ˜˜#˜˜c¤$ u£+ ¨bÐ1Õ2ð3ð ‡MM#ÔØ W‰WV‹_€Fð
ˆg‰J€EØ
ˆcä ˆu‹:˜Š>ô-¬s´4Ø AoÒ&‰b¨AÑ.ó4ó0òà ñ"ñ"€Fð€Ü+¨FÓ3‰ä˜f gÓ.ˆØ‡HHˆVÕrcó—t||d«y)zð Write the header for an array using the 1.0 format.
 
    Parameters
    ----------
    fp : filelike object
    d : dict
        This has the appropriate entries for writing its string
        representation to the header of the file.
    rN©rs©r%rNs  rÚwrite_array_header_1_0rwás€ô˜˜A˜vÕ&rcó—t||d«y)a4 Write the header for an array using the 2.0 format.
        The 2.0 format allows storing very large structured arrays.
 
    Parameters
    ----------
    fp : filelike object
    d : dict
        This has the appropriate entries for writing its string
        representation to the header of the file.
    rNrurvs  rÚwrite_array_header_2_0ryïs€ô˜˜A˜vÕ&rcó—t|d|¬«S)a²
    Read an array header from a filelike object using the 1.0 file format
    version.
 
    This will leave the file object located just after the header.
 
    Parameters
    ----------
    fp : filelike object
        A file object or something with a `.read()` method like a file.
 
    Returns
    -------
    shape : tuple of int
        The shape of the array.
    fortran_order : bool
        The array data will be written out directly if it is either
        C-contiguous or Fortran-contiguous. Otherwise, it will be made
        contiguous before writing it out.
    dtype : dtype
        The dtype of the file's data.
    max_header_size : int, optional
        Maximum allowed size of the header.  Large headers may not be safe
        to load securely and thus require explicitly passing a larger value.
        See :py:func:`ast.literal_eval()` for details.
 
    Raises
    ------
    ValueError
        If the data is invalid.
 
    r©rÚmax_header_size©Ú_read_array_header©r%r|s  rÚread_array_header_1_0r€þó€ôD Ø ˜°ô AðArcó—t|d|¬«S)a²
    Read an array header from a filelike object using the 2.0 file format
    version.
 
    This will leave the file object located just after the header.
 
    Parameters
    ----------
    fp : filelike object
        A file object or something with a `.read()` method like a file.
    max_header_size : int, optional
        Maximum allowed size of the header.  Large headers may not be safe
        to load securely and thus require explicitly passing a larger value.
        See :py:func:`ast.literal_eval()` for details.
 
    Returns
    -------
    shape : tuple of int
        The shape of the array.
    fortran_order : bool
        The array data will be written out directly if it is either
        C-contiguous or Fortran-contiguous. Otherwise, it will be made
        contiguous before writing it out.
    dtype : dtype
        The dtype of the file's data.
 
    Raises
    ------
    ValueError
        If the data is invalid.
 
    rr{r}rs  rÚread_array_header_2_0rƒ$rrcó—ddl}ddlm}g}d}|j||«j«D]C}|d}|d}|r||j
k(r|dk(rŒ$|j |«||jk(}ŒE|j|«S)a6Clean up 'L' in npz header ints.
 
    Cleans up the 'L' in strings representing integers. Needed to allow npz
    headers produced in Python2 to be read in Python3.
 
    Parameters
    ----------
    s : string
        Npy file header.
 
    Returns
    -------
    header : str
        Cleaned up header.
 
    rN)ÚStringIOFrÚL)    ÚtokenizeÚior…Úgenerate_tokensÚreadlineÚNAMErAÚNUMBERÚ
untokenize)Úsr‡r…ÚtokensÚlast_token_was_numberÚtokenÚ
token_typeÚ token_strings        rÚ_filter_headerr”Js•€ó"Ýà €FØ!ÐØ×)Ñ)©(°1«+×*>Ñ*>Ó?ò    @ˆØ˜1‘Xˆ
ؘQ‘xˆ Ù !ؘhŸm™mÒ+Ø Ò#Ø à M‰M˜%Ô  Ø!+¨x¯©Ñ!>Ñð    @ð × Ñ ˜vÓ &Ð&rcó.—ddl}ddl}tj|«}|€t    d|›«‚|\}}t ||j |«d«}|j||«d}    t ||    d«}
|
j|«}
t|
«|kDrt    dt|
«›d«‚    |j|
«} t#| t$«sd }t    |j!| ««‚t&| j)«k7r5t+| j)««}d}t    |j!|««‚t#| dt,«rt/d„| dD««sd}t    |j!| d««‚t#| dt0«sd}t    |j!| d««‚    t3| d«}| d| d|fS#t$r•} |dkrht|
«}
    |j|
«} tjd    td
¬ «nK#t$r"} d }t    |j!|
««| ‚d} ~ wwxYwd }t    |j!|
««| ‚Yd} ~ Œ¤d} ~ wwxYw#t4$r%} d}t    |j!| d««| ‚d} ~ wwxYw)z#
    see read_array_header_1_0
    rNzInvalid version zarray header lengthz array headerzHeader info length (zä) is large and may not be safe to load securely.
To allow loading, adjust `max_header_size` or fully trust the `.npy` file using `allow_pickle=True`.
For safety against large resource use or crashes, sandboxing may be necessary.rzŸReading `.npy` or `.npz` file required additional header parsing as it was created on Python 2. Save the file again to speed up loading and avoid this warning.ér)zCannot parse header: {!r}z Header is not a dictionary: {!r}z.Header does not contain the correct keys: {!r}rc3ó<K—|]}t|t«–—Œy­w©N)r;Úint)Ú.0Úxs  rú    <genexpr>z%_read_array_header.<locals>.<genexpr>¯sèø€Ò;¨1”J˜q¤#×&Ñ;ùs‚zshape is not valid: {!r}rz'fortran_order is not a valid bool: {!r}rz+descr is not a valid dtype descriptor: {!r})ÚastrSrTÚgetrr#rWÚunpackÚdecoder?Ú literal_evalÚ SyntaxErrorr”r+r,r-Úformatr;ÚdictÚ EXPECTED_KEYSÚkeysrkr=ÚallÚboolr>Ú    TypeError)r%rr|rrSÚhinfoÚ hlength_typer\Ú hlength_strÚ header_lengthrZrNÚeÚe2rr¦r2s                 rr~r~ms€ó ÛÜ × !Ñ ! 'Ó *€EØ €}ÜÐ+¨G¨;Ð7Ó8Ð8Ø"Ñ€L(ä˜b &§/¡/°,Ó"?ÐAVÓW€KØ—M‘M ,° Ó<¸QÑ?€MÜ ˜˜]¨NÓ ;€FØ ]‰]˜8Ó $€FÜ
ˆ6ƒ{_Ò$ÜØ"¤3 v£; -ð0 ð  ó!ð    !ð$8Ø × Ñ ˜VÓ $ˆô$ aœÔ Ø0ˆÜ˜Ÿ™ A›Ó'Ð'䘟™›Ò Üa—f‘f“hÓˆØ>ˆÜ˜Ÿ™ DÓ)Ó*Ð*ô q˜‘z¤5Ô )ÜÑ;°°'±
Ô;Ô;Ø(ˆÜ˜Ÿ™ A g¡JÓ/Ó0Ð0Ü a˜Ñ(¬$Ô /Ø7ˆÜ˜Ÿ™ A oÑ$6Ó7Ó8Ð8ð8ܘq ™zÓ*ˆð
ˆW‰:q˜Ñ)¨5Ð 0Ð0øôQ ò8Ø fÒ Ü# FÓ+ˆFð
/Ø×$Ñ$ VÓ,ô
— ‘ ðMô ¨Aö    /øô    ò =Ø1Ü  §¡¨FÓ!3Ó4¸"Ð<ûð =úð.ˆCܘSŸZ™Z¨Ó/Ó0°aÐ 7õ/ûð8ûôH ò8Ø;ˆÜ˜Ÿ™ A g¡JÓ/Ó0°aÐ7ûð8úsTÂ)GÆ,I&Ç    I#ÇIÇH Ç0IÈ     H8ÈH3È3H8È8 IÉI#É&    JÉ/ JÊJcóœ—t|«t|t|«|«|jdk(rd}nt    d|jzd«}t |j «}|j js |jsX|s8|j jr td«‚|js td«‚|€i}tj||fddi|¤Žy|jjr~|jjsht|«r|j j#|«yt%j&|gd    ¢|d
¬ «D]"}|j)|j+d ««Œ$yt|«r|j#|«yt%j&|gd    ¢|d ¬ «D]"}|j)|j+d ««Œ$y) a
    Write an array to an NPY file, including a header.
 
    If the array is neither C-contiguous nor Fortran-contiguous AND the
    file_like object is not a real file object, this function will have to
    copy data in memory.
 
    Parameters
    ----------
    fp : file_like object
        An open, writable file object, or similar object with a
        ``.write()`` method.
    array : ndarray
        The array to write to disk.
    version : (int, int) or None, optional
        The version number of the format. None means use the oldest
        supported version that is able to store the data.  Default: None
    allow_pickle : bool, optional
        Whether to allow writing pickled data. Default: True
    pickle_kwargs : dict, optional
        Additional keyword arguments to pass to pickle.dump, excluding
        'protocol'. These are only useful when pickling objects in object
        arrays to Python 2 compatible format.
 
    Raises
    ------
    ValueError
        If the array cannot be persisted. This includes the case of
        allow_pickle=False and array being an object array.
    Various other errors
        If the array contains Python objects as part of its dtype, the
        process of pickling them may raise various errors if the objects
        are not picklable.
 
    rirz5Object arrays cannot be saved when allow_pickle=Falsez;User-defined dtypes cannot be saved when allow_pickle=FalseNÚprotocolr–)Ú external_loopÚbufferedÚ zerosize_okÚF)rJÚ
buffersizeÚorderÚC)rrsrOr:Úmaxr/r2Ú    hasobjectr0rÚpickleÚdumprJrLrKÚ    isfileobjÚTÚtofiler<ÚnditerrpÚtobytes)r%rMrÚ allow_pickleÚ pickle_kwargsr¶Ú dtype_classÚchunks        rÚ write_arrayrƾs…€ôJ7ÔܘÔ6°uÓ=¸wÔGà ‡~~˜Ò؉
ô˜¨5¯>©>Ñ9¸1Ó=ˆ
äu—{‘{Ó#€Kà ‡{{×Ò K×$7Ò$7ñ؏{‰{×$Ò$Ü ð"6ó7ð7à×&Ò&Ü ð";ó<ð<à Ð  ØˆM܏ ‰ E˜2Ñ;¨Ð;¨]Ó;Ø    ‰×    !Ò    !¨%¯+©+×*BÒ*BÜ RŒ=Ø G‰GN‰N˜2Õ äŸ™ØÒ!MØ)°ô6ò -ð—‘˜Ÿ™ sÓ+Õ,ñ -ô
2ŒØ  ‰ RÕä—\‘\ØÒIØ%¨Sô2ò    )ˆEð H‰HU—]‘] 3Ó'Õ (ñ    )r©r|c    óÖ—|rd}t|«}t|«t|||¬«\}}}t|«dk(rd}n/tj
j |tj¬«}|jr*|s td«‚|€i}    tj|fi|¤Ž}    |    St|«rt    j|||¬
«}    n«t    j||¬«}    |j dkDr…t"t%t"|j «z} t'd|| «D]T} t%| || z
«} t)| |j z«}t+||d «}t    j,||| ¬
«|    | | | zŒV|    j.|k7rtd |›d |›d|    j.›d«‚|r|ddd…|    _|    j3«}    |    S||    _|    S#t$r}
td|
›d    «|
‚d}
~
wwxYw)a*
    Read an array from an NPY file.
 
    Parameters
    ----------
    fp : file_like object
        If this is not a real file object, then this may take extra memory
        and time.
    allow_pickle : bool, optional
        Whether to allow writing pickled data. Default: False
    pickle_kwargs : dict
        Additional keyword arguments to pass to pickle.load. These are only
        useful when loading object arrays saved on Python 2.
    max_header_size : int, optional
        Maximum allowed size of the header.  Large headers may not be safe
        to load securely and thus require explicitly passing a larger value.
        See :py:func:`ast.literal_eval()` for details.
        This option is ignored when `allow_pickle` is passed.  In that case
        the file is by definition trusted and the limit is unnecessary.
 
    Returns
    -------
    array : ndarray
        The array from the data on disk.
 
    Raises
    ------
    ValueError
        If the data is invalid, or allow_pickle=False and the file contains
        an object array.
 
    lrÇrr)r2z6Object arrays cannot be loaded when allow_pickle=FalseNz#Unpickling a python object failed: z8
You may need to pass the encoding= option to numpy.load)r2Úcountz
array dataz,Failed to read all data for array. Expected z = z elements, could only read z* elements. (file seems not fully written?)rj)r'rr~r?r<ÚmultiplyÚreduceÚint64rºrr»ÚloadÚ UnicodeErrorr½ÚfromfileÚndarrayr:Ú BUFFER_SIZEÚminÚranger™r#Ú
frombufferÚsizerÚ    transpose)r%rÂrÃr|rrrr2rÉrMÚerrÚmax_read_countÚiÚ
read_countÚ    read_sizeÚdatas                rÚ
read_arrayrÝ s€ñFð ˆä˜‹n€Gܐ7ÔÜ"4Ø ¨ô#:Ñ€Eˆ=˜%ä
ˆ5ƒzQ‚؉䗑×%Ñ% e´5·;±;Ð%Ó?ˆð ‡‚áÜð2ó3ð 3à Ð  ØˆMð    BÜ—K‘K Ñ4 mÑ4ˆEðb €LôU RŒ=ä—N‘N 2¨U¸%Ô@‰Eô—M‘M %¨uÔ5ˆEà~‰~ Ò!ä!,´´KÀÇÁÓ0PÑ!Pä˜q %¨Ó8òOAÜ!$ ^°U¸Q±YÓ!?JÜ # J°·±Ñ$?Ó @IÜ& r¨9°lÓCDÜ.3×.>Ñ.>¸tÈ5ØCMô/OE˜!˜A 
™NÑ+ð    Oð :‰:˜Ò ÜðØ!˜7 # e Wð-#Ø#(§:¡: ,ð/2ð2óð ñ Ø¡ " ™+ˆEŒKØ—O‘OÓ%ˆEð €Lð ˆEŒKà €Løôaò    Båâ25ð 8ó9à>Að Bûð    Bús G
Ç
    G(ÇG#Ç#G(cóЗt|«r td«‚d|vr‘t|«tj|«}|j
r d}t|«‚t |«||dœ}ttj|«|dz«5}    t|    ||«|    j«}
ddd«nyttj|«d«5}    t|    «}t|«t|    ||¬«\}}}|j
r d}t|«‚|    j«}
ddd«|rd    } nd
} |d k(rd }tj|||| |
¬ «} | S#1swYŒ4xYw#1swYŒ@xYw)a˜
    Open a .npy file as a memory-mapped array.
 
    This may be used to read an existing file or create a new one.
 
    Parameters
    ----------
    filename : str or path-like
        The name of the file on disk.  This may *not* be a file-like
        object.
    mode : str, optional
        The mode in which to open the file; the default is 'r+'.  In
        addition to the standard file modes, 'c' is also accepted to mean
        "copy on write."  See `memmap` for the available mode strings.
    dtype : data-type, optional
        The data type of the array if we are creating a new file in "write"
        mode, if not, `dtype` is ignored.  The default value is None, which
        results in a data-type of `float64`.
    shape : tuple of int
        The shape of the array if we are creating a new file in "write"
        mode, in which case this parameter is required.  Otherwise, this
        parameter is ignored and is thus optional.
    fortran_order : bool, optional
        Whether the array should be Fortran-contiguous (True) or
        C-contiguous (False, the default) if we are creating a new file in
        "write" mode.
    version : tuple of int (major, minor) or None
        If the mode is a "write" mode, then this is the version of the file
        format used to create the file.  None means use the oldest
        supported version that is able to store the data.  Default: None
    max_header_size : int, optional
        Maximum allowed size of the header.  Large headers may not be safe
        to load securely and thus require explicitly passing a larger value.
        See :py:func:`ast.literal_eval()` for details.
 
    Returns
    -------
    marray : memmap
        The memory-mapped array.
 
    Raises
    ------
    ValueError
        If the data or the mode is invalid.
    OSError
        If the file is not found or cannot be opened correctly.
 
    See Also
    --------
    numpy.memmap
 
    zZFilename must be a string or a path-like object.  Memmap cannot use existing file handles.Úwz6Array can't be memory-mapped: Python objects in dtype.)rrrÚbNÚrbrÇrµr¸zw+úr+)r2rr·ÚmoderC)r½rrr<r2rºr4ÚopenÚosÚfspathrsÚtellr'r~Úmemmap) Úfilenamerãr2rrrr|rrNr%rCr·Úmarrays              rÚ open_memmaprëzsr€ôpÔÜðFóGð    Gð ˆd{ô    wÔô— ‘ ˜EÓ"ˆØ ?Š?ØJˆCܘS“/Ð !ä# EÓ*Ø*Øñ
ˆô ”"—)‘)˜HÓ% t¨c¡zÓ 2ð    °bÜ   A wÔ /Ø—W‘W“YˆF÷    ð    ô
”"—)‘)˜HÓ% tÓ ,ð        °Ü  “nˆGÜ ˜7Ô #ä*<ؘ°ô+BÑ 'ˆE= %àŠØNÜ  “oÐ%Ø—W‘W“YˆF÷        ñ؉àˆð ˆt‚|Øˆä \‰\˜(¨%°uÀEØ ˜&ô"€Fð €M÷;    ð    ú÷
        ð        úsÂEà AEÅEÅE%có—d}        |j|t|«z
«}||z }t|«dk(st|«|k(rn    ŒBt|«|k7rd}t|||t|«fz«‚|S#t$rYŒ8wxYw)a+
    Read from file-like object until size bytes are read.
    Raises ValueError if not EOF is encountered before size bytes are read.
    Non-blocking objects only supported if they derive from io objects.
 
    Required as e.g. ZipExtFile in python 2.6 can return less data than
    requested.
    rrz)EOF: reading %s, expected %d bytes got %d)Úreadr?ÚBlockingIOErrorr)r%rÕÚerror_templaterÜÚrrs      rr#r#æs›€ð €DØ
ð    Ø—‘˜œs 4›yÑ(Ó)ˆAØ A‰IˆDܐ1‹v˜Š{œc $›i¨4Ò/Øð0ð ô ˆ4ƒyDÒØ9ˆÜ˜ °´c¸$³iÐ@Ñ@ÓAÐAàˆ øô ò    Ù ð    ús…>A2Á2    A>Á=A>có¸—t|tjtjtjf«sy    |j «y#t $rYywxYw)NFT)r;rˆÚFileIOÚBufferedReaderÚBufferedWriterÚfilenoÚOSError)Úfs rr½r½sK€ä aœ"Ÿ)™)¤R×%6Ñ%6¼×8IÑ8IÐJÔ KØðð    
‰Œ
ØøÜ òÙðús¼A Á     AÁAr˜)NTN)FN)râNNFN)zran out of data))Ú__doc__rˆrår»r+r<Ú numpy._utilsrÚnumpy.lib._utils_implrÚ__all__Ú
__module__r¥rr?r$rVrÑrorTÚ_MAX_HEADER_SIZErr r'r4r>rOr`rdrsrwryr€rƒr”r~rÆrÝrër#r½©rrú<module>rÿs$ðñbóF
Û    Û Ûã Ý#Ý/à
€à-€ Ôâ3€ Ø€ Ù  Ó  Ñ !€    Ø€ Ø€ àÐð
Ø Ø ñÐðÐò+ñ  Ð Óñ0ó ð0ñ. Ð Óñó ðñ( Ð Óñ8ó ð8ñv Ð Óñ6Aó ð6Añr Ð Óñ ó ð ò8:ò0ó0!ñH Ð Óñ
'ó ð
'ñ Ð Óñ 'ó ð 'ñ Ð ÓØ.>ò"Aó ð"AñJ Ð ÓØ.>ò"Aó ð"AòJ 'ðF5EóN1ñb Ð ÓòJ)ó ðJ)ñZ Ð ÓðjØ/ójó ðjñZ Ð ÓØ7;Ø-1ðhà 0óhó ðhóVñ8 Ð Óñ    ó ñ    r