2018年 08月 07日
>>> a = [[1,2,3],[4,5,6]] >>> b = a >>> a[0][0],a[1][1] = 100,200 >>> a [[100, 2, 3], [4, 200, 6]] >>> b [[100, 2, 3], [4, 200, 6]]
>>> import copy >>> a = [[1,2,3],[4,5,6]] >>> b = copy.deepcopy(a) >>> a[0][0],a[1][1] = 100,200 >>> a [[100, 2, 3], [4, 200, 6]] >>> b [[1, 2, 3], [4, 5, 6]]
>>> a = np.array([[1,2,3],[4,5,6]]) >>> b = np.array([[2,4,6],[3,6,9]]) >>> b = a >>> a[0][0],a[1][1] = 100,200 >>> a array([[100, 2, 3], [ 4, 200, 6]]) >>> b array([[100, 2, 3], [ 4, 200, 6]])
>>> a = np.array([[1,2,3],[4,5]]) >>> b = np.array([[2,4,6],[3,6]]) >>> b = np.copy(a) >>> a[0][0],a[1][1] = 100,200 >>> a array([list([100, 2, 3]), list([4, 200])], dtype=object) >>> b array([list([100, 2, 3]), list([4, 200])], dtype=object)
>>> a = np.array([[1,2,3],[4,5,6]]) >>> b = np.array([[2,4,6],[3,6,9]]) >>> b = copy.deepcopy(a) >>> a[0][0],a[1][1] = 100,200 >>> a array([[100, 2, 3], [ 4, 200, 6]]) >>> b array([[1, 2, 3], [4, 5, 6]])
>>> a = np.array([[1,2,3],[4,5]]) >>> b = np.array([[2,4,6],[3,6]]) >>> b = copy.deepcopy(a) >>> a[0][0],a[1][1] = 100,200 >>> a array([list([100, 2, 3]), list([4, 200])], dtype=object) >>> b array([list([1, 2, 3]), list([4, 5])], dtype=object)
>>> a = np.array([[1,2,3],[4,5,6]]) >>> a array([[1, 2, 3], [4, 5, 6]]) >>> a[...] array([[1, 2, 3], [4, 5, 6]])
>>> a = np.array([[1,2,3],[4,5,6]]) >>> b = np.array([[2,4,6],[3,6,9]]) >>> b[...]=a >>> a[0][0],a[1][1] = 100,200 >>> a array([[100, 2, 3], [ 4, 200, 6]]) >>> b array([[1, 2, 3], [4, 5, 6]])
>>> ... Ellipsis >>> type(...)