To much logic inside list comprehension?

Viewed 105

I have a list comprehension in my code that looks something like this :

dataPointList = [
     map(str, 
        [ elem for elem in dataFrame[column] 
           if not pd.isnull(elem) and '=' in elem
        ]
     ) for column in list(dataFrame)
]

I was wondering, is there a general rule of thumb when to break up a list comprehension? Can you have too much logic inside a list comprehension?

1 Answers
Related