econml/utilities.py
def tocoo(X):
    """
    Convert an array to a sparse COO array.

    If the input is already an `sparse.COO` object, this returns the object directly; otherwise it is converted.
    """
    if isinstance(X, sp.COO):
        return X
    elif isinstance(X, sp.DOK):
        return sp.COO(X)
    elif scipy.sparse.issparse(X):
        return sp.COO.from_scipy_sparse(X)
    else:
        return sp.COO.from_numpy(X)

    Convert an array to a sparse COO array.

    If the input is already an `sparse.COO` object, this returns the object directly; otherwise it is converted.
    
Convert an array to a sparse COO array.
If the input is already an `sparse.COO` object, this returns the object directly; otherwise it is converted.
Convert an array to a sparse COO array . If the input is already an ` sparse . COO ` object this returns the object directly ; otherwise it is converted .
def tocoo(X):
    if isinstance(X, sp.COO):
        return X
    elif isinstance(X, sp.DOK):
        return sp.COO(X)
    elif scipy.sparse.issparse(X):
        return sp.COO.from_scipy_sparse(X)
    else:
        return sp.COO.from_numpy(X)
def tocoo ( X ) : if isinstance ( X , sp . COO ) : return X elif isinstance ( X , sp . DOK ) : return sp . COO ( X ) elif scipy . sparse . issparse ( X ) : return sp . COO . from_scipy_sparse ( X ) else : return sp . COO . from_numpy ( X )
Convert an array to a sparse COO array.
Convert an array to a sparse COO array .
"""
    Convert an array to a sparse COO array.

    If the input is already an `sparse.COO` object, this returns the object directly; otherwise it is converted.
    """
X