Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

numpy save dict to txt

import numpy as np

# Save
dictionary = {'hello':'world'}
np.save('my_file.npy', dictionary) 

# Load
read_dictionary = np.load('my_file.npy',allow_pickle='TRUE').item()
print(read_dictionary['hello']) # displays "world"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #numpy #save #dict #txt
ADD COMMENT
Topic
Name
4+7 =