I have a list which looks something like this.
DB
Out[469]:
[[3 523
Name: order_id, dtype: object], 0 [526, 533]
Name: order_id, dtype: object, Series([], Name: order_id, dtype: object)]
And what I want it to look like this.
DB
[['523',['526','533']]]
I am doing following in python
DB[0][0].values[0]
Out[462]: '523'
DB[1][0]
Out[463]: ['526', '533']
And to remove empty series
[x for x in DB if x != []]
But It doesn't work. I want a for loop which will iterate through DB and give me final output. Please help.
[x for x in l if len(x)>0]?