I am recieving some POST data every three seconds (precisely 384 rows). These are stored in list called data. Then I would like to store them in list helper, which would be appended by data after every POST. For now I want to check the data in graph, so I need to convert helper into numpy array, which is called myArr.
data = json.loads(json_data)["data"] #I get some data
helper=[] #Then create list
helper.append(data) # And here I would like to add values to the end
myArr=np.asarray(helper)
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
self.wfile.write("")
print (len(data))
print(type (data))
print (len(helper))
print(type (helper))
print (len(myArr))
print(type (myArr))
print data
But when I execute the code, the lenghts are not the same:
>>384
>><type 'list'>
>>1
>><type 'list'>
>>1
>><type 'numpy.ndarray'>
And the list data content looks like this:
[[0.46124267578125, 0.0545654296875, 0.89111328125, 0.0, 0.0, 0.0, 0.0],
[0.46124267578125, 0.0545654296898, 0.89111328125, 0.0, 0.0, 0.0, 0.0],
[0.46124267578125, 0.0545654296875, 0.89111328125, 0.0, 0.0, 0.0, 0.0],
[0.4637451171875, 0.05804443359362, 0.8892822265625, 0.0, 0.0, 0.0, 0.0],
[0.4637451171875, 0.05804443359301, 0.8892822265625, 0.0, 0.0, 0.0, 0.0],
[0.4637451171875, 0.05804443359375, 0.8892822265625, 0.0, 0.0, 0.0, 0.0],
[etc.]]
I think there's just problem with dimensions of lists which I can not figure out.
list_c = list_a + list_bor in your casehelper += data