pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.79k stars 17.98k forks source link

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

Open Anaphory opened 8 years ago

Anaphory commented 8 years ago

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)

jreback commented 8 years ago

mostly a dupe of #8826

the only ones with any rationale are:

tolist -> to_list (for compat with rest of pandas to_* methods) hasnans -> hasna (inconsistent naming, e.g. fillna, dropna)

the other are long long established and in particular searchsorted, itemsize, astype are super common numpy references

sortlevel should actually be deprecated as sort_index does all of this.