Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to convert a matrix string back to a matrix python

from ast import literal_eval as safe_eval

string = '[[396, 555], [326, 337], [467, 332]]'
print(safe_eval(string))

# will return: [[396, 555], [326, 337], [467, 332]]
 
PREVIOUS NEXT
Tagged: #convert #matrix #string #matrix #python
ADD COMMENT
Topic
Name
9+3 =