Skip to content

Inconsistent use of _ to separate words in method names #14278

Open
@Anaphory

Description

@Anaphory

Sometimes, method names contain underscores to separate words (to_string) and sometimes not (tolist). This catches me of regularly. Particulary annoying are the cases where the same prefix (eg. to) sometimes takes an underscore and sometimes not.

Is this going to change for future major versions?

Example: dir(Index)

  • Without underscore between words, but the compound is well-established: 'argmax', 'argmin', 'argsort', 'nbytes', 'ndim', 'nlevels', 'nunique', 'putmask'
  • Without underscore: 'astype', 'fillna', 'hasnans', 'isin', 'itemsize', 'searchsorted', 'sortlevel', 'tolist'
  • With underscore: 'drop_duplicates', 'get_duplicates', 'get_indexer', 'get_indexer_for', 'get_indexer_non_unique', 'get_level_values', 'get_loc', 'get_slice_bound', 'get_value', 'get_values', 'groupby', 'has_duplicates', 'holds_integer', 'inferred_type', 'is_all_dates', 'is_boolean', 'is_categorical', 'is_floating', 'is_integer', 'is_lexsorted_for_tuple', 'is_mixed', 'is_monotonic', 'is_monotonic_decreasing', 'is_monotonic_increasing', 'is_numeric', 'is_object', 'is_type_compatible', 'is_unique', 'memory_usage', 'set_names', 'set_value', 'slice_indexer', 'slice_locs', 'sort_values', 'sym_diff', 'symmetric_difference', 'to_datetime', 'to_native_types', 'to_series', 'value_counts'

Metadata

Metadata

Assignees

No one assigned

    Labels

    API - ConsistencyInternal Consistency of API/BehaviorEnhancementNeeds DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions