0

I need to store a dictionary of which keys are dates and values are a list of strings.

The file was originally stored by matlab in .mat with only around 100MB. When we try to store it in pickle, it become 1G. Are there any good ways to save this dictionary in python?

niukasu
  • 267
  • 2
  • 4
  • 8

1 Answers1

1

You can serialise the dictionary into json and write it out onto the disk. You'll need to convert the dates into some unambiguous format. If it's too big, you can zip files. Since they're text, they should compress fairly well.

Noufal Ibrahim
  • 71,383
  • 13
  • 135
  • 169