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
+ 21 comments import numpy as np a, b, c = map(int,input().split()) arrA = np.array([input().split() for _ in range(a)],int) arrB = np.array([input().split() for _ in range(b)],int) print(np.concatenate((arrA, arrB), axis = 0))
+ 4 comments you don't actually need to concatenate anything to pass this challenge
+ 6 comments import numpy as np N, M, _ = [int(x) for x in raw_input().strip().split()] a, b = map(lambda x: np.array([raw_input().strip().split() for i in xrange(int(x))], int), [N, M]) print np.concatenate((a, b), axis = 0)
+ 2 comments import numpy as np n,m,p=map(int,input().split()) lis=[] for i in range(n+m): inp=input().split() lis.append(inp) print(np.array(lis,int))
+ 0 comments import numpy inp = input() inp=[int(x) for x in inp.split(" ")] N=inp[0] #1st matrix row M=inp[1] #2nd matrix row P=inp[2] #col mat1=[] mat2=[] for i in range(N): row = list(map(int,input().split(" "))) mat1.append(row) for i in range(M): row = list(map(int,input().split(" "))) mat2.append(row) arry1 = numpy.array(mat1) arry2 = numpy.array(mat2) arry1=numpy.reshape(arry1,(N,P)) arry2=numpy.reshape(arry2,(M,P)) print(numpy.concatenate((arry1,arry2),axis=0))
Load more conversations
Sort 277 Discussions, By:
Please Login in order to post a comment