STAG Python  2.0.2
Spectral Toolkit of Algorithms for Graphs
Loading...
Searching...
No Matches
stag.data Namespace Reference

Classes

class  DataPoint
 A data point in d-dimensional space. More...
 

Functions

stag.utility.DenseMat load_matrix (str filename)
 Load data into a matrix from a file.
 

Function Documentation

◆ load_matrix()

stag.utility.DenseMat stag.data.load_matrix ( str  filename)

Load data into a matrix from a file.

Each line of the file corresponds to a row in the matrix. On each row, matrix entries should be separated by blank spaces, or commas. Every row in the file must contain the same number of entries.

Lines beginning with '#' or '//' are ignored.

Parameters
filenamethe name of the file containing the data
Returns
a stag.utility.DenseMat containing the data from the file
Exceptions
aruntime exception if the file doesn't exist or cannot be parsed