def nodestrength(mtx, mean=False):
    """
    Compute the node strength of a graph.

    Parameters
    ----------
    mtx : numpy.ndarray
        A matrix depicting a graph.
    mean : bool, optional
        If True, return the average node strength along the last axis of mtx.

    Returns
    -------
    numpy.ndarray
        The node strength.
    """
    ns = abs(mtx).sum(axis=0)

    if mean:
        ns = ns.mean(axis=-1)

    return ns