# Buggy code
def duplicated(self, subset=None, keep="first"):
    """
    Return boolean Series denoting duplicate rows, optionally only
    considering certain columns

    Parameters
    ----------
    subset : column label or sequence of labels, optional
        Only consider certain columns for identifying duplicates, by
        default use all of the columns
    keep : {'first', 'last', False}, default 'first'
        - ``first`` : Mark duplicates as ``True`` except for the
          first occurrence.
        - ``last`` : Mark duplicates as ``True`` except for the
          last occurrence.
        - False : Mark all duplicates as ``True``.

    Returns
    -------
    duplicated : Series
    """
    from pandas.core.sorting import get_group_index
    from pandas._libs.hashtable import duplicated_int64, _SIZE_HINT_LIMIT

    def f(vals):
        labels, shape = algorithms.factorize(
            vals, size_hint=min(len(self), _SIZE_HINT_LIMIT)
        )
        return labels.astype("i8", copy=False), len(shape)

    if subset is None:
        subset = self.columns
    elif (
        not np.iterable(subset)
        or isinstance(subset, compat.string_types)
        or isinstance(subset, tuple)
        and subset in self.columns
    ):
        subset = (subset,)

    # Verify all columns in subset exist in the queried dataframe
    # Otherwise, raise a KeyError, same as if you try to __getitem__ with a
    # key that doesn't exist.
    diff = Index(subset).difference(self.columns)
    if not diff.empty:
        raise KeyError(diff)

    vals = (col.values for name, col in self.iteritems() if name in subset)
    labels, shape = map(list, zip(*map(f, vals)))

    ids = get_group_index(labels, shape, sort=False, xnull=False)
    return Series(duplicated_int64(ids, keep), index=self.index)


# Traceback (ValueError)
pd.DataFrame().drop_duplicates()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/analytical-monk/miniconda3/lib/python3.6/site-packages/pandas/core/frame.py", line 3098, in drop_duplicates
duplicated = self.duplicated(subset, keep=keep)
File "/home/analytical-monk/miniconda3/lib/python3.6/site-packages/pandas/core/frame.py", line 3144, in duplicated
labels, shape = map(list, zip(*map(f, vals)))
ValueError: not enough values to unpack (expected 2, got 0)

# Fixed code
def duplicated(self, subset=None, keep="first"):
    """
    Return boolean Series denoting duplicate rows, optionally only
    considering certain columns

    Parameters
    ----------
    subset : column label or sequence of labels, optional
        Only consider certain columns for identifying duplicates, by
        default use all of the columns
    keep : {'first', 'last', False}, default 'first'
        - ``first`` : Mark duplicates as ``True`` except for the
          first occurrence.
        - ``last`` : Mark duplicates as ``True`` except for the
          last occurrence.
        - False : Mark all duplicates as ``True``.

    Returns
    -------
    duplicated : Series
    """
    from pandas.core.sorting import get_group_index
    from pandas._libs.hashtable import duplicated_int64, _SIZE_HINT_LIMIT

    if self.empty:
        return Series()

    def f(vals):
        labels, shape = algorithms.factorize(
            vals, size_hint=min(len(self), _SIZE_HINT_LIMIT)
        )
        return labels.astype("i8", copy=False), len(shape)

    if subset is None:
        subset = self.columns
    elif (
        not np.iterable(subset)
        or isinstance(subset, compat.string_types)
        or isinstance(subset, tuple)
        and subset in self.columns
    ):
        subset = (subset,)

    # Verify all columns in subset exist in the queried dataframe
    # Otherwise, raise a KeyError, same as if you try to __getitem__ with a
    # key that doesn't exist.
    diff = Index(subset).difference(self.columns)
    if not diff.empty:
        raise KeyError(diff)

    vals = (col.values for name, col in self.iteritems() if name in subset)
    labels, shape = map(list, zip(*map(f, vals)))

    ids = get_group_index(labels, shape, sort=False, xnull=False)
    return Series(duplicated_int64(ids, keep), index=self.index)