msgpi.utils.io.textToMatrix
msgpi.utils.io.textToMatrix#
- msgpi.utils.io.textToMatrix(textList)#
Convert the text of a block of numbers into a matrix
- Parameters
textList (list of strings) – The block of text representing a matrix
- Returns
A matrix of numbers.
- Return type
list of lists of floats
Examples
>>> lines = ['1 2 3', '4 5 6', '7 8 9'] >>> utilities.textToMatrix(lines) [[1., 2., 3.], [4., 5., 6.], [7., 8., 9.]]