read_pickle()

Pandas

path ( file ) Path with file name to store the byte string of pickled data
compression(Optional )Type of compression, {'infer', 'gzip', 'bz2', 'zip', 'xz', None}
file to DataFrame by read_pickle() We can read the binary file and create a DataFrame data by using read_pickle().
import pandas as pd
import pickle
my_data=pd.read_pickle('my_data.pkl')
print(my_data)
Output
   NAME  ID  MATH  ENGLISH
0  Ravi   1    30       20
1  Raju   2    40       30
2  Alex   3    50       40
The file is located in the current directory. Check for the file my_data.pkl . You can use path to read the file in different location.
my_data=pd.read_pickle("D:\my_data\my_data.pkl")

Compression

We can add compression option. ( You must have used the same type of compression while creating the file )
my_data=pd.read_pickle('my_data.pkl',compression='zip')
to_pickle()
Read how to pickle data stored in a MySQL table.
Pandas read_clipboard() read_html() read_csv() read_excel() to_excel()
Data input and output from Pandas DataFrame


plus2net.com



Post your comments , suggestion , error , requirements etc here




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer