1# save numpy array as npy file
2from numpy import asarray
3from numpy import save
4# define data
5data = asarray([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]])
6# save to npy file
7save('data.npy', data)
8
9# load numpy array from npy file
10from numpy import load
11# load array
12data = load('data.npy', allow_pickle=True))
13# print the array
14print(data)
1# save numpy array as npy file
2from numpy import asarray
3from numpy import save
4# define data
5data = asarray([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]])
6# save to npy file
7save('data.npy', data)
8
9# load numpy array from npy file
10from numpy import load
11# load array
12data = load('data.npy')
13# print the array
14print(data)