You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -80,7 +80,7 @@ for data parsing, and can handle different data types within the same file. It
80
80
<br>
81
81
82
82
83
-
### 3. numpy.load
83
+
### 3. numpy.load():
84
84
`load` method is used to load arrays saved in NumPy’s native binary format (.npy or .npz). These files preserve the array structure, data types, and metadata.
85
85
It’s an efficient way to store and load large arrays.
86
86
@@ -90,18 +90,19 @@ It’s an efficient way to store and load large arrays.
90
90
```
91
91
92
92
**fname** : Name of the file <br>
93
-
**mmap_mode** : Memory-map the file using the given mode (r, r+, w+, c).(By Default None)<br>
93
+
**mmap_mode** : Memory-map the file using the given mode (r, r+, w+, c)(By Default None).Memory-mapping only works with arrays stored in a binary file on disk, not with compressed archives like .npz.<br>
94
94
**encoding**:Encoding is used when reading Python2 strings only. (By Default ASCII) <br>
95
95
96
96
-#### Example for `load`:
97
97
98
98
**Code** <br>
99
99
```python
100
100
import numpy as np
101
+
101
102
arr = np.array(['a','b','c'])
102
-
np.savez('data.npz', array=arr)
103
-
# stores arr in data.npz in NumPy's native binary format
104
-
data = np.load('data.npz')
103
+
np.savez('example.npz', array=arr)# stores arr in data.npz in NumPy's native binary format
0 commit comments