[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


Is this what you mean?

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

For more info, check out list comprehension

1

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