plpy.execute will give you a list of dict, so you want something like
sum([x['laius'] for x in Xarray])
More info in the docs here http://www.postgresql.org/docs/devel/static/plpython-database.html
Edit: I read too quickly and skimmed over your entire function - you may want to put the list constructor higher up, probably right after executing your queries, so that you have a list of values to use later on (I didn't notice how much of the later code assumes the data are in a simple list).