def manhattan(x, y, rnd_feature_idxs):
    """
    Calculates the conventional pairwise Manhattan city
    block distance between two vectors, but limited to
    the `rnd_feature_idxs` specified.

    Parameters
    ----------
    x: float array
        The first vector of the vector pair.
    y: float array
        The second vector of the vector pair.
    rnd_feature_idxs: int array
        The list of indexes along which the distance
        has to be calculated (useful for bootstrapping).

    Returns
    ----------
    float: manhattan(x, y)

    References:
    ----------
    - Cha SH. Comprehensive Survey on Distance/Similarity Measures
      between Probability Density Functions. International Journ.
      of Math. Models and Methods in Applied Sciences. 2007;
      1(4):300–307.
    """

    diff, z = 0.0, 0.0

    for i in rnd_feature_idxs:
        z = x[i]-y[i]

        if z < 0.0:
            z = -z

        diff += z

    return diff