I have a dict with like a million keys and each value is a 10000-dim sparse list, eg,
dic = {'a': [0] * 10000, 'b': [0] * 1234 + [1, 2] + [0] * 8764, ...}
Dumping the object via pickle is not quite efficient as it takes a ton of disk spaces. Is there a way/package that I could save/load this kind of object efficiently?
只需将列表对象替换为scipy稀疏矩阵 (例如,使用csr矩阵)。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.