Created
February 15, 2019 20:11
-
-
Save Robofied/3a7ebebc20b72fa0b41bdec045bb52bd to your computer and use it in GitHub Desktop.
Numpy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Creating the array of one's | |
a = np.ones((1,1)) | |
## creating another array | |
b = np.arange(4) | |
## saving both the arrays in the same file using savez as .npz | |
savez('outfile1',a,b) | |
## Loading the saved .npz file | |
npzfile = np.load('outfile1.npz') | |
## Checking the files in the .npz file | |
print (npzfile.files) | |
#[Output]: | |
#['arr_1', 'arr_0'] | |
## accessing the content of first file in.npz | |
print(npzfile['arr_0']) | |
#[Output]: | |
#[[1.]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment