human
How can I check if a Pandas dataframe's index is sorted
assistant
Here is some code to check if a pandas dataframe `df`'s index is sorted

all(df.index[:-1] <= df.index[1:])

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.