I've set up a dataframe:
df = pd.DataFrame({'Name': ['Alice', 'Bob', 'Aritra'],
'Age': [25, 30, 35],
'Location': ['Seattle', 'New York', 'Kona']},
index=([10, 20, 30]))
I ask the user to put in which row of the data they want to see. They input a 0
, indicating the first row.
However, df.loc[0]
does not refer to the first row. Instead, it doesn't exist, because the index
only has the values 10, 20, and 30.
Is there terminology to distinguish these two types of indexes? The best I could come up with is ordinal indexes (for "What number row is this?") and dataframe indexes (for "What is the index of this row in the dataframe?").
To clarify, under my definitions, df.index(ordinal_index) == df_index
.
Is there a standard terminology for this?