Answers for "add two 2d numpy array"

3

join two numpy 2d array

import numpy as np

a = np.array([[0, 1, 3], [5, 7, 9]])
b = np.array([[0, 2, 4], [6, 8, 10]])
c = np.concatenate((a, b), axis=0)
print(c)

Output : 
[[ 0  1  3]
 [ 5  7  9]
 [ 0  2  4]
 [ 6  8 10]]
Posted by: Guest on September-23-2020
0

how to add elements in 2d array in python

n,m=int(input()),int(input())
   for i in range(0,n):
      for j in range(0,m):
         a[i].append(int(input()))
Posted by: Guest on April-07-2021

Python Answers by Framework

Browse Popular Code Answers by Language