![]() |
STAG Python
2.1.2
Spectral Toolkit of Algorithms for Graphs
|
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. | |
None | save_matrix (stag.utility.DenseMat data, str filename) |
Save a data matrix to a text file. | |
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.
filename | the name of the file containing the data |
a | runtime exception if the file doesn't exist or cannot be parsed |
None stag.data.save_matrix | ( | stag.utility.DenseMat | data, |
str | filename | ||
) |
Save a data matrix to a text file.
data | the matrix to save |
filename | the name of the file to save the matrix to |
a | runtime exception if the file cannot be opened for writing |