파이썬 numpy의 2D 배열에서 특정 위치에 행을 삽입합니까?
해결 방법 >>> import numpy as np >>> a = np.zeros((2, 2)) >>> a array([[ 0., 0.], [ 0., 0.]]) # In the following line 1 is the index before which to insert, 0 is the axis. >>> np.insert(a, 1, np.array((1, 1)), 0) array([[ 0., 0.], [ 1., 1.], [ 0., 0.]]) >>> np.insert(a, 1, np.array((1, 1)), 1) array([[ 0., 1., 0.], [ 0., 1., 0.]]) 참조 페이지 https://stackoverflow.com/questions/8298797
2020. 9. 22.