["python","pandas","dataframe"]
How do I get the name of the rows from the index of a data frame?

Consider a data frame with row names that aren't a column of their own per se, such as the following: X Y Row 1 0 5 Row 2 8 1 Row 3 3 0 How would I extract the name of these rows as a list, if I have their index? For example, it would look something like: function_name(dataframe[indices]) > ['Row 1', 'Row 2']
df.index outputs the row names as pandas Index object. list(df.index) casts to a list. df.index['Row 2':'Row 5'] supports label slicing similar to columns.