I want to remove empty list and extra [] around elements
Input: data = [[1], [], [2], [], [], [4]];
Expected: output = [1,2,4]
When I do this : d = [x for x in data if x]
I have an output with [] around elements as below:
[[1], [2], [4]]
Appreciate if someone can help!