Uncompress the specified file and read the binary output as an array.
(fpath, shape=None, dtype=None)
| 196 | |
| 197 | |
| 198 | def gunzip_array(fpath, shape=None, dtype=None): |
| 199 | """ |
| 200 | Uncompress the specified file and read the binary output as an array. |
| 201 | """ |
| 202 | with gzip.open(fpath) as fi: |
| 203 | data = np.frombuffer(fi.read(), dtype=dtype) |
| 204 | if shape is not None: |
| 205 | return data.reshape(shape) |
| 206 | |
| 207 | |
| 208 | load_file = functools.partial( |
nothing calls this directly
no outgoing calls
no test coverage detected