Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas to pickle

# use pickle format to save columns with complex data (like list) 
# and keep their structure

>>> original_df = pd.DataFrame({"foo": range(5), "bar": range(5, 10)})
>>> original_df
   foo  bar
0    0    5
1    1    6
2    2    7
3    3    8
4    4    9
>>> original_df.to_pickle("./dummy.pkl") # use read_pickle to read the dataframe
Comment

PREVIOUS NEXT
Code Example
Python :: jupyter notebook change default directory 
Python :: python get files in directory 
Python :: how to display a manytomany field in django rest framework 
Python :: sqlalchemy create engine PostgreSQL 
Python :: log of number python 
Python :: remove last element from dictionary python 
Python :: pandas reorder columns 
Python :: car in programming python 
Python :: find nth root of m using python 
Python :: pandas find basic statistics on column 
Python :: list to tuple 
Python :: round godot 
Python :: django queryset unique values 
Python :: pandas to csv float format 
Python :: python ls directory 
Python :: all subarrays of an array python 
Python :: https flask 
Python :: add rectangle matplotlib 
Python :: python dataclass default factory 
Python :: how to draw shape square in python turtle 
Python :: python list remove spaces 
Python :: python last element list 
Python :: median absolute deviation scipy 
Python :: date to day python 
Python :: python get names of all classes 
Python :: Iterate through python string starting at index 
Python :: python get system information 
Python :: remove emoji from dataframe 
Python :: python sum dictionary values by key 
Python :: pandas read_csv nan as empty string 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =