I'm using python w/ scipy package to read the MatLab file.
However it takes too long and crashes.
The Dataset is about 50~ MB in size
Is there any better way to read the data and form an edge list ?
My python code
import scipy.io as io
data=io.loadmat('realitymining.mat')
print data
By default, Python is not capable of reading . mat files.
Opening the Editor Without Starting MATLAB On Windows platforms, you can use the MATLAB Editor without starting MATLAB. To do so, double-click an M-file in Windows Explorer. The M-file opens in the MATLAB Editor. To open the Editor without a file, open $matlabroot/bin/win32/meditor.exe .
To load saved variables from a MAT-file into your workspace, double-click the MAT-file in the Current Folder browser. To load a subset of variables from a MAT-file on the Home tab, in the Variable section, click Import Data.
load( filename ) loads data from filename . If filename is a MAT-file, then load(filename) loads variables in the MAT-file into the MATLAB® workspace. If filename is an ASCII file, then load(filename) creates a double-precision array containing data from the file.
You could just save each field of the struct in a different text file, eg:
save('friends.txt', '-struct', 'network', 'friends', '-ascii')
and load each file separately from python
friends = numpy.loadtxt('friends.txt')
which loads instantly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With