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
Sort by
recency
|
459 Discussions
|
Please Login in order to post a comment
import numpy as np
n,m,p = map(int,input().split()) ar1 = np.array([input().split() for i in range(n)], int) ar2 = np.array([input().split() for i in range(m)], int)
print(np.concatenate((ar1,ar2), axis=0))
Here is HackerRank Concatenate in Python solution - https://programmingoneonone.com/hackerrank-concatenate-problem-solution-in-python.html
I get what we're going for here, but I can't help but notice that none of the methods this was probably designed to test are actually necessary. There's no reason to concatenate, or handle the length of each array, nor worry about which axis it will be joined on, because the damn input is already formatted as a 2d array!
I get what we're going for here, but I can't help but notice that none of the methods this was probably designed to test are actually necessary. There's no reason to concatenate, or handle the length of each array, nor worry about which axis it will be joined on, because the damn input is already formatted as a 2d array!