list conprehension with dataframe code example
Example 1: comprehension list iloc pandas
df['col2'] = [int(x) for x in df['col1']]
Example 2: comprehension list iloc pandas
mat = [[1,2], [3,4], [5,6]]
[x for row in mat for x in row if x%2==1]
df['col2'] = [int(x) for x in df['col1']]
mat = [[1,2], [3,4], [5,6]]
[x for row in mat for x in row if x%2==1]