1

I've seen this question, but I'm having trouble with using save_npz.

I have a dictionary of scipy sparse csr matrices called adj_mat_time_t.

I'm trying to save it to a file via:

scipy.sparse.save_npz('binary_adj_mats.npz', adj_mat_time_t)

The error:

Traceback (most recent call last):
    ...
  File "my_prog.py", line 400...
    scipy.sparse.save_npz('binary_adj_mats.npz', adj_mat_time_t)
  File "/user/pkgs/anaconda2/lib/python2.7/site-packages/scipy/sparse/_matrix_io.py", line 64, in save_npz
    arrays_dict = dict(format=matrix.format.encode('ascii'),
AttributeError: 'dict' object has no attribute 'format'

I'm working with scipy version 1.0.0

How can I fix this?

Community
  • 1
  • 1
StatsSorceress
  • 3,019
  • 7
  • 41
  • 82

0 Answers0