0

I have 2 nested lists like the following and i'm trying to flatten them so i am able to plot the data:

List1 = [[[2189.369140625]], [[2715.13818359375]], ... , [[2810.3173828125]]]
List2 = [[3372.06005859375], [3376.110107421875], ... , [3344.18994140625]]

I tried using list comprehensions like this:

List2 = [item for sublist in List2 for item in sublist]

But it returns this error:

TypeError: 'float' object is not iterable
Specter07
  • 201
  • 4
  • 12

0 Answers0