對於您的示例,您可以使用numpy.lib.stride_tricks.as_strided。 In [1]: A = np.arange(16).reshape(4, 4) In [2]: ...
確定! 回上一頁