Concatenate

Sort by

recency

|

432 Discussions

|

  • + 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)
    
  • + 0 comments

    import numpy as np r1,r2,c =map(int,input().split()) lt=[] for i in range(r1): l =list(map(int,input().split())) lt.append(l) ll=[] for m in range(r2): l2 =list(map(int,input().split())) ll.append(l2) lt1=np.array(lt,dtype=int) ll1=np.array(ll,dtype=int)

    print (np.concatenate((lt1, ll1)) )

  • + 0 comments

    Enter your code here. Read input from STDIN. Print output to STDOUT

    import numpy as np a=input().strip().split() n=int(a[0]) m=int(a[1]) p=int(a[2]) b=n+m arr=[] for _ in range(b): rows=list(map(int,input().strip().split())) arr.append(rows)

    c=np.array(arr) print (c) 1.

  • + 0 comments
    import numpy as n
    NM=[*map(int, input().split()[:2])]
    A,B=[n.array([[*map(int, input().split())]for _ in range(NM[i])]) for i in range(2)]
    print(n.concatenate((A, B),axis=0))