Concatenate

Sort by

recency

|

435 Discussions

|

  • + 0 comments

    import numpy N, M, P = list(map(int, input().strip().split()))

    arr_1 = numpy.array([input().strip().split()[:P] for _ in range(N)], dtype=numpy.int32) arr_2 = numpy.array([input().strip().split()[:P] for _ in range(M)], dtype=numpy.int32) print(numpy.concatenate((arr_1, arr_2)))

  • + 0 comments

    import numpy N, M, P = list(map(int, input().split())) out_arr = [] for _ in range(N+M): row = numpy.array(list(map(int, input().split()))[:P]) out_arr.append(row) print(numpy.concatenate([out_arr], axis = 1))

  • + 0 comments

    import numpy as np

    n, m, p = map(int, input().strip().split())

    arr_1 = np.array([input().strip().split() for _ in range(n)], dtype=np.int32) arr_2 = np.array([input().strip().split() for _ in range(m)], dtype=np.int32)

    print(np.concatenate((arr_1, arr_2), axis=0))

  • + 0 comments

    import numpy as np n,m,p = input().split() arr1 = [] arr2 = [] for i in range(int(n)): narr = list(map(int, input().split())) arr1.append(narr) for j in range(int(m)): marr = list(map(int, input().split())) arr2.append(marr)

    arr1 = np.array(arr1) arr2 = np.array(arr2) print(np.concatenate((arr1, arr2)))

  • + 0 comments
    import numpy as np
    
    N, M, P = map(int, input().split())
    A = []
    B = []
    
    for _ in range(N):
        A.append(list(map(int, input().split())))
        
    for _ in range(M):
        B.append(list(map(int, input().split())))
        
    ar=np.concatenate([A,B],axis=0)
    print(ar)