[docs] problem using pickle

Andres Soto andres.soto.v at gmail.com
Fri Oct 25 10:39:25 CEST 2013

I am trying to save a Naive Bayes classifier with cPickle (as it says in
NLTK: Storing Taggers http://nltk.org/book/ch05.html), but I got an error.
These are the function code I used to save/load it:

import cPickle as cp

def salva_fichC(fich1,data):
    f = open(fich, 'wb')
    cp.dump(data, f,-1)

def carga_fichC(fich1):
    f = open(fich, 'rb')
    data = cp.load(f)
    return data

I have tried also with pickle, with and without -1 in dump
Can you help me? Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20131025/9cf10976/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Captura de pantalla 2013-10-25 a la(s) 10.30.50.png
Type: image/png
Size: 33588 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/docs/attachments/20131025/9cf10976/attachment-0001.png>

More information about the docs mailing list