We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Numpy
- Concatenate
- Discussions
Concatenate
Concatenate
+ 0 comments import numpy as np N, M, P = list(map(int, input().split())) arr1 = np.array([input().split() for _ in range(N)], dtype='int') arr2 = np.array([input().split() for _ in range(M)], dtype='int') print(np.concatenate((arr1, arr2), axis=0))
+ 0 comments N,M,P=map(int,input().split()) print('[',end='') for i in range(N+M): l=input().split() print('[',' '.join(l),']',sep='', end='') if not i==(N+M-1):print(end="\n ") print("]")
+ 0 comments import numpy as np
a=input().split() N=int(a[0]) M=int(a[1]) P=int(a[2])
liste_0=np.full((N,P),(1,2)) liste_1=np.full((M,P),(3,4)) print(np.concatenate((liste_0,liste_1),axis=0))
+ 0 comments Tell me why not do it this way.
import numpy as np n, m, _ = map(int, input().split()) li = [] for _ in range(n + m - 1): li.append(list(map(int, input().split()))) arr1 = np.array(li) li = list(map(int, input().split())) arr2 = np.array(li, ndmin=2) print(np.concatenate((arr1, arr2)))
+ 1 comment import numpy as np N, M, P = map(int, input().split()) p = [list(map(int, input().split())) for i in range(N)] m = [list(map(int, input().split())) for i in range(M)] arr1 = np.array(p) arr2 = np.array(m) print(np.concatenate((arr1, arr2), axis=0))
Load more conversations
Sort 376 Discussions, By:
Please Login in order to post a comment