Skip to content

BUG: algorithms._count_generic? #6092

Closed
@dsm054

Description

@dsm054

algorithms._count_generic returns a Series built from counts, which isn't defined:

def _count_generic(values, table_type, type_caster):
    from pandas.core.series import Series

    values = type_caster(values)
    table = table_type(min(len(values), 1000000))
    uniques, labels = table.factorize(values)

    return Series(counts, index=uniques)

but this function doesn't seem to be used anywhere. The only reference I can find is in algorithms.count, or what would be algorithms.count, but that's commented out:

# def count(values, uniques=None):
#     f = lambda htype, caster: _count_generic(values, htype, caster)

#     if uniques is not None:
#         raise NotImplementedError
#     else:
#         return _hashtable_algo(f, values.dtype)

Metadata

Metadata

Assignees

No one assigned

    Labels

    AlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffInternalsRelated to non-user accessible pandas implementationNumeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions