Home / Python Numpy / How to Sort a Boolean Array in NumPy In this example we will show how to sort a boolean array in Python NumPy. Source Code import numpy as np n = np.array([True, False, True, False]) print(np.sort(n)) Output: [False False True True]