<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _construct(x, categories):
 """Make a sparse matrix from an encoded array. array([[1., 0.], [0., 1.], [1., 0.]]) """

    # type: (np.ndarray, np.ndarray) -> scipy.sparse.csr_matrix
    data = np.ones(len(x))
    rows = np.arange(len(x))
    columns = x.ravel()
    return scipy.sparse.csr_matrix(
        (data, (rows, columns)), shape=(len(x), len(categories))
    )