Hi I'm having a hard time iteration over an array of dictionaries and can't figure it out what's failing
This is the data:
total = [{'table_id': 'IA_AUTO_2020-11-25', 'created': datetime.datetime(2020, 11, 25, 5, 36, 1, 281000, tzinfo=datetime.timezone.utc)},
{'table_id': 'IA_AUTO_2020-12-07', 'created': datetime.datetime(2020, 12, 7, 5, 55, 4, 142000, tzinfo=datetime.timezone.utc)},
{'table_id': 'IA_AUTO_2020-12-09', 'created': datetime.datetime(2020, 12, 9, 5, 52, 55, 48000, tzinfo=datetime.timezone.utc)}]
And this is the iteration code:
n=[]
d=[]
for t in total:
n.append(t.table_id)
d.append(t.created)
total.append(t.table_id)
total.append(t.created)
print(n)
But I get the error:
` for t in total:
print(t)
> n.append(t.table_id)
for t in total('trending_CL'):
TypeError: 'list' object is not callable`
An important note: I can't change the loop structure, but rater modify the data structure to make it work
I'm aware the issue must be rather simple, but really can't find it