问题来源:怎么在ndarray和list之间进行转换。
list 转 numpy
np.array(a)
ndarray 转 list
a.tolist()
但是无意中发现list(a)也是可以的。
但是list明明是系统的关键字,
list @overload def __init__(self) -> None
Possible types:
• (self: list) -> None
• (self: list, iterable: Iterable[_T]) -> None
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified. # (copied from class doc)
查阅文档发现,只要是一个可迭代对象就可以转换成list对象。