I have the following python code which compares two numbers and stores either true or false in the array. However, in stead of storing it like this:
[True, False, True....]
It stores it like this:
[array([ True]), array([ False]), array([ True])]
Here's the code:
def runSample(file_name):
samples=open(file_name,'r').readlines()
result=[]
check = False
for line in samples:
data=json.loads(line);
check=data[-1]==clf.predict([data[:-1]])
result.append(check)
print(result)
result.append(check).item()if check is not Nonesamples