若有幫助到你,記得點贊哦!
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 25 09:58:19 2018
@author: Lelouch_C.C
"""
from numpy import *
a= mat([[1,2,3],
[4,5,6],
[7,8,9]])
c=a.tolist()
print(c)
"""
輸出:
[[1, 2, 3], [4, 5, 6], [7, 8, 9]] #可以看出,tolist()將矩陣a轉換爲一個以列表爲元素的列表
"""