Try:
array[array['phase']=='P']
array['phase']=='P' returns a boolean numpy array. When idx is a boolean array, array[idx] returns an array composed of those rows where idx is True.
array['phase']=='P'
idx
array[idx]
True
Try this code:
array[array.phase=='P']