def MakePmfFromCdf(cdf, name=None):
if name is None:<EOL><INDENT>name = cdf.name<EOL><DEDENT>pmf = Pmf(name=name)<EOL>prev = <NUM_LIT:0.0><EOL>for val, prob in cdf.Items():<EOL><INDENT>pmf.Incr(val, prob - prev)<EOL>prev = prob<EOL><DEDENT>return pmf<EOL>
Makes a normalized Pmf from a Cdf object.

    Args:
        cdf: Cdf object
        name: string name for the new Pmf

    Returns:
        Pmf object