Skip to content

Instantly share code, notes, and snippets.

@tkazusa
Created December 12, 2018 07:01
Show Gist options
  • Save tkazusa/e0cfe2e7fe76c7c6eee3d768727095c3 to your computer and use it in GitHub Desktop.
Save tkazusa/e0cfe2e7fe76c7c6eee3d768727095c3 to your computer and use it in GitHub Desktop.
arr = np.empty((0,3), int)
arr = np.append(arr, np.array([[1, 2, 3],[4, 5, 6]]), axis=0)
arr = np.append(arr, np.array([[7, 8, 9],[10, 11, 12]]), axis=0)
arr.reshape(-1,2,3)
>array([[[ 1, 2, 3],
> [ 4, 5, 6]],
> [[ 7, 8, 9],
> [10, 11, 12]]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment