def hash_vector(self, v, querying=False):
        """
        Hashes the vector and returns the binary bucket key as string.
        """
        if scipy.sparse.issparse(v):
            # If vector is sparse, make sure we have the CSR representation
            # of the projection matrix
            if self.components_csr == None:
                self.components_csr = scipy.sparse.csr_matrix(self.components)
            # Make sure that we are using CSR format for multiplication
            if not scipy.sparse.isspmatrix_csr(v):
                v = scipy.sparse.csr_matrix(v)
            # Project vector onto all hyperplane normals
            projection = self.components_csr.dot(v).toarray()
        else:
            # Project vector onto all hyperplane normals
            projection = numpy.dot(self.components, v)
        # Return binary key
        return [''.join(['1' if x >= 0.0 else '0' for x in projection])]
dataset/ETHPy150Open pixelogik/NearPy/nearpy/hashes/pcabinaryprojections.py/PCABinaryProjections.hash_vector/operator `>` -> `>=`