Search a unique list and search a larger list to set dictionary with keys of binary values
== with broadcasting is the most straightforward solution:

array_to_search = np.array(np.random.randint(0,5,(1,10))).ravel()
array_of_unique_values = np.unique(array_to_search)

# Creates the binary vectors
matches = array_of_unique_values[:, None] == array_to_search

# Converts to dict
output = dict(zip(array_of_unique_values, matches))


You can also set return_indices flag to True in np.unique and use these to create the table:

array_to_search = np.array(np.random.randint(0,5,(1,10))).ravel()
array_of_unique_values, indices = np.unique(array_to_search, return_inverse=True)
matches = np.zeros((array_of_unique_values.size, array_to_search.size), dtype=bool)
matches[indices, np.arange(array_to_search.size)] = True
output = dict(zip(array_of_unique_values, matches))