Transform “list of tuples” into a flat list or a matrix

后端 未结 9 2006
北荒
北荒 2020-11-27 13:17

With Sqlite, a \"select..from\" command returns the results \"output\", which prints (in python):

>>print output
[(12.2817, 12.2817), (0, 0), (8.52, 8.         


        
9条回答
  •  心在旅途
    2020-11-27 13:46

    Or you can flatten the list like this:

    reduce(lambda x,y:x+y, map(list, output))
    

提交回复
热议问题