A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/7121 below:

df.sortlevel() vs df.sort_index() · Issue #7121 · pandas-dev/pandas · GitHub

Q1: For a multi-index dataframe, what is the difference between sortlevel() and sort_index()?

As far as I can tell, for a dataframe like:

  df = pd.DataFrame({'A' : [np.random.random_integers(10) for x in xrange(500)], 
                     'B' : [np.random.random_integers(10) for x in xrange(500)], 
                     'C' : [np.random.random_integers(10) for x in xrange(500)],
                     'data' : randn(500) })

the result is the same.

Q2: Why do these methods not use the same naming convention? sort_index uses underscore to separate words, while sortlevel is just one word.

What is the official convention in Pandas? Isn't the Python convention to use underscore splitting?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4