How to flatten a tuple in python

前端 未结 6 1545
挽巷
挽巷 2020-11-30 13:42

I have the following element of a list, and the list is 100 elements long.

[(50, (2.7387451803816479e-13, 219))]

How do I convert each elem

6条回答
  •  自闭症患者
    2020-11-30 14:03

    You can get the result in this way

    >> example =  [(50, (2.7387451803816479e-13, 219))]
    >>> [tuple(x[:1]) + (x[1]) for x in example] 
    [(50, 2.738745180381648e-13, 219)]
    

提交回复
热议问题