def remove_position(p, name):
    """Remove a position from a portfolio by name.

    Parameters
    ----------
    p : alphapy.Portfolio
        Portfolio with the current position.
    name : int
        Unique identifier for the position, e.g., a stock symbol.

    Returns
    -------
    p : alphapy.Portfolio
        Portfolio with the deleted position.

    """
    del p.positions[name]
    return p
