python 矩阵转字符串,再转回矩阵
文章目录
1、矩阵s转字符串s_str:s_str=s.tostring() 2、字符串s_str转矩阵s: import numpy as np s = np.fromstring(s_str,dtype=float).reshape(矩阵s维度,矩阵s维度)
1、矩阵s转字符串s_str:s_str=s.tostring() 2、字符串s_str转矩阵s: import numpy as np s = np.fromstring(s_str,dtype=float).reshape(矩阵s维度,矩阵s维度)
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论