Python matrix problems

后端 未结 3 977
情深已故
情深已故 2021-01-28 09:41

This is continued from this thread: Python matrix, any solution?


Input

from numpy import *
import numpy

x=[[\'1\',\'7\'],
 [\'1.5         


        
3条回答
  •  忘了有多久
    2021-01-28 10:08

    Convert x to a numpy array of numbers:

    x = numpy.asanyarray([[float(z) for z in y] for y in x])
    

提交回复
热议问题