xlrd and cPickle.dump

P

patrick.waldo

Hi all,

I have to work with a very large excel file and I have two questions.

First, the documentation says that cPickle.dump would be the best way
to work with it. However, I keep getting:
Traceback (most recent call last):
File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework
\scriptutils.py", line 310, in RunScript
exec codeObject in __main__.__dict__
File "C:\python_files\pickle_test.py", line 12, in ?
cPickle.dump(book,wb.save(pickle_path))
File "C:\Python24\lib\copy_reg.py", line 69, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle file objects

I tried to use open(filename, 'w') as well as pyExcelerator
(wb.save(pickle_path)) to create the pickle file, but neither worked.

Secondly, I am trying to make an ID number from three columns of data:
category | topic | sub_topic, so that I can . I imagine that a
dictionary would be the best way to sort out the repeats
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,955
Messages
2,570,117
Members
46,705
Latest member
v_darius

Latest Threads

Top