osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

numpy results in segmentation fault


Hi ,

I was trying to solve the hackerrank and was using python 3.7.x.
https://www.hackerrank.com/challenges/np-concatenate/problem

While running the code sometimes I get success result and sometimes it
fails with "Segmentation Fault" at Hacker rank UI. I dont have any clue why
the code is crashing ? Does anyone have any idea?

Regards
Pradeep

import numpy

n,m,p = map(int,input().split())
tgt_arr1 = []
for i in range(n):
    row = list(map(int,input().split()))
    tgt_arr1.append(row)
tgt_arr2 = []
for j in range(m):
    row = list(map(int,input().split()))
    tgt_arr2.append(row)

num_arr1 = numpy.array(tgt_arr1,int)
num_arr2 = numpy.array(tgt_arr2,int)

print(numpy.concatenate((num_arr1,num_arr2),axis=0))