Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

save a dict to pickle

import pickle

a = {'hello': 'world'}

with open('filename.pickle', 'wb') as handle:
    pickle.dump(a, handle, protocol=pickle.HIGHEST_PROTOCOL)

with open('filename.pickle', 'rb') as handle:
    b = pickle.load(handle)
Comment

save a dict to pickle

import pickle

a = {'hello': 'world'}

with open('filename.pickle', 'wb') as handle:
    pickle.dump(a, handle, protocol=pickle.HIGHEST_PROTOCOL)

with open('filename.pickle', 'rb') as handle:
    b = pickle.load(handle)
Comment

PREVIOUS NEXT
Code Example
Python :: rename keys in dictionary python 
Python :: pandas remove repeated index 
Python :: pandas show full columns 
Python :: sum along axis python 
Python :: how to correlation with axis in pandas 
Python :: read parquet from s3 and convert to dataframe 
Python :: flask dockerize 
Python :: Python write value in next row of existing .text file 
Python :: flask set cookie 
Python :: how to get wikipedia photos using wikipedia module ip python 
Python :: react-native-dropdown-picker 
Python :: group by 2 columns pandas 
Python :: how to add space in st.write streamlit 
Python :: video capture opencv and multiprocessing 
Python :: last element of list python 
Python :: python constant 
Python :: django model get field verbose name 
Python :: python elapsed time in milliseconds 
Python :: transformers bert 
Python :: ordenar lista python 
Python :: cufflink install python jupyter 
Python :: check for string in list pytho 
Python :: seaborn color palette python 
Python :: django x-frame-options allowall 
Python :: use proxy to connect smtp python 
Python :: how to plot kmeans centroids 
Python :: python .format 
Python :: pycord discord discordpy get total slash commands and total commands regestered in your bot 
Python :: convert pandas group to dict 
Python :: create virtual env pyhton3 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =