I speak a bit of python and the problem is probably here. For a row this would create a string like this:
[ "1", "aaaa"]
Which is an array of values not a dict. Normally you'd build and send a dict using something like this :
myDoc = {
"code" : row[0],
"name": row[1]
}