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.
N, M, P = map(int, input().split())
NP = numpy.array([input().split() for i in range(N)], int)
MP = numpy.array([input().split() for j in range(M)], int)
print(numpy.concatenate((NP, MP), axis = 0))
Why is that writing the code in below fashion gives addresses and not the expected result?
import numpy
N, M, P = map(int, input().split())
NP = numpy.array([map(int, input().split()) for i in range(N)])
MP = numpy.array([map(int, input().split()) for j in range(M)])
print(numpy.concatenate((NP, MP), axis = 0))
Solution to above:
[<map object at 0x7f4a5171d1d0> <map object at 0x7f4a516eb2b0>
<map object at 0x7f4a516eb2e8> <map object at 0x7f4a516f0780>
<map object at 0x7f4a516f0710> <map object at 0x7f4a49972da0>
<map object at 0x7f4a4946d390>]
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Concatenate
You are viewing a single comment's thread. Return to all comments →
Python 3: Below code works fine: import numpy
Why is that writing the code in below fashion gives addresses and not the expected result?
Solution to above: