Hi, lets say you have: [[8,0,5]]
but you want: [8,0,5]
how might we go about doing that?
Thanks
Hi, lets say you have: [[8,0,5]]
but you want: [8,0,5]
how might we go about doing that?
Thanks
If you have many lists (a list of lists) then to reduce that by one level of depth, concatenate.
See itertools.chain
(that’s concatenate, just a different name)
not python, but to show the behaviour:
>>> concat [[[8,0,5]]]
[[8,0,5]]
>>> concat [[8,0,5]]
[8,0,5]
>>> concat [[8],[0,5]]
[8,0,5]
>>> concat []
[]