def cdivide(a, b):
    '''
    cdivide(a, b) returns the quotient a / b as a numpy array object. Like numpy's divide function
      or a/b syntax, divide will thread over the latest dimension possible. Unlike numpy's divide,
      cdivide works with sparse matrices.

    Note that warnings/errors are raised by this function when divide-by-zero occurs, so it is
    usually not useful to use cdivide() with sparse matrices--see czdivide instead.
    '''
    if   sps.issparse(a): return a.multiply(inv(b))
    elif sps.issparse(b): return np.asarray(a) / b.toarray()
    else:                 return np.asarray(a) / np.asarray(b)
def cdivide ( a , b ) : if sps . issparse ( a ) : return a . multiply ( inv ( b ) ) elif sps . issparse ( b ) : return np . asarray ( a ) / b . toarray ( ) else : return np . asarray ( a ) / np . asarray ( b )
cdivide(a, b) returns the quotient a / b as a numpy array object. Like numpy's divide function
      or a/b syntax, divide will thread over the latest dimension possible. Unlike numpy's divide,
      cdivide works with sparse matrices.

    Note that warnings/errors are raised by this function when divide-by-zero occurs, so it is
    usually not useful to use cdivide() with sparse matrices--see czdivide instead.