flatten list in python

后端 未结 5 1570
南旧
南旧 2021-01-26 01:04

I want to flatten the list:

exampleArray = [[[151.68694121866872]], 
                [[101.59534468349297]], 
                [[72.16055999176308]]]
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-26 02:00

    For fixed level of depth (as in example) you can just sum enough times:

    sum(sum(listoflistsoflists, []), [])
    

提交回复
热议问题