Pickle (.pkl) File Format
Pickle file format
Description
Examples
Pickle is a binary file format for storing arbitrary Python data.
The general-purpose commands Import and Export support this format.
Export accepts any input which is accepted by convert/python.
Import produces an expression of type python.
Note that this file format is not secure. It is possible to construct malicious pickle data which will execute arbitrary code on import. It should therefore only be used with trusted data.
Encode a matrix as a pickle expression.
pickledmatrix≔convert⁡1,2|3,4,ByteArray,format=Pickle
Import a pickled expression from a file.
Import⁡example/address.pkl,base=datadir
table⁡founded=1988,companyName=Maplesoft,phoneNumbers=<Python object: {'type': 'local', 'number': '+1 (519) 747-2373'}>,<Python object: {'type': 'tollfree', 'number': '+1 (800) 267-6583'}>,<Python object: {'type': 'fax', 'number': '+1 (519) 747-5284'}>,address=table⁡country=Canada,postalCode=N2V 1K8,province=ON,city=Waterloo,streetAddress=615 Kumpf Drive
Import the same data, but as a python expression.
Import⁡example/address.pkl,base=datadir,output=python
<Python object: {'founded': 1988, 'address': {'country': 'Canada', 'postalCode': 'N2V 1K8', 'province': 'ON', 'city': 'Waterloo', 'streetAddress': '615 Kumpf Drive'}, 'phoneNumbers': [{'type': 'local', 'number': '+1 (519) 747-2373'}, {'type': 'tollfree', 'number': '+1 (800) 267-6583'}, {'type': 'fax', 'number': '+1 (519) 747-5284'}], 'companyName': 'Maplesoft'}>
See Also
Formats
Formats,NPY
Formats,NPZ
Download Help Document