[Solved] python how to create a new array, list or even a new column with objects from an array, list or column with a set criteria

[ad_1]

Is this what you mean?

print(len([x for x in train['Survived'] if x == 1]))

For more info, check out list comprehension

1

[ad_2]

solved python how to create a new array, list or even a new column with objects from an array, list or column with a set criteria