def save_npz(filename, obj, compression=True):
 s = DictionarySerializer()
 s.save(obj)
 with open(filename, 'wb') as f:
  if compression:
   numpy.savez_compressed(f, **s.target)
  else:
   numpy.savez(f, **s.target)

def save_npz ( filename , obj , compression = True ) : s = DictionarySerializer ( ) s . save ( obj ) with open ( filename , 'wb' ) as f : if compression : numpy . savez_compressed ( f , ** s . target ) else : numpy . savez ( f , ** s . target )
save a sparse matrix to a file using .