I'm loading an array from a bucket content in S3, but when I load the array and printed the string using the following code:
for obj_array in bucket_array.objects.all():
json_array = obj_array.get()['Body'].read()
it has the u
character at the beginning of each value like follows:
current array:
{
u'values': [{
u'sensor': u'2',
u'temperature': u'24.5',
u'unit': u 'celsius',
u'datetime': u'23-02-2017 21:03:50'
}, {
u'sensor': u'2',
u'temperature': u'24.5',
u'unit': u'celsius',
u'datetime': u'24-02-2017 4:00:36'
}]
}
So, when I tried to do array_data = json.loads(json_array)
it throws me the following error:
Expecting property name: line 1 column 2 (char 1): ValueError
Any ideas how to solve this?