View Single Post
  #4   Spotlight this post!  
Unread 03-03-2015, 18:00
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: can Python open a matrix saved by Octave in sparse format?

Quote:
Originally Posted by Ether View Post
Attached ZIP file contains a 17842x2696 matrix with 53526 non-zero elements stored in Octave sparse format.

Can Python load a matrix stored in this format?
Octave loads the file in less than half a second, and converts it to full format in about a third of a second:

Code:


GNU Octave, version 3.6.4
Copyright (C) 2013 John W. Eaton and others.
This is free software; see the source code for copying conditions.
Octave was configured for "i686-pc-mingw32".

Additional information about Octave is available at http://www.octave.org.

+ ## load the alliances design matrix
+ tic;
+ load ('$A.dat');
+ toc
Elapsed time is 0.422 seconds.
+ [alliances, teams] = size (A)
alliances =  17842
teams =  2696
+ matches = alliances / 2
matches =  8921
+ ## convert it to full
+ tic;
+ Af = full (A);
+ toc
Elapsed time is 0.343 seconds.
+ endscript;
Reply With Quote