If you want to sort the DataFrame rows by the index in descending order, set the ascending argument to False. main.py import pandas as pd df = pd.DataFrame({ 'name': ['Alice', 'Bobby', 'Carl', 'Dan', 'Ethan'], 'experience': [1, 1, 5, 7, 7], 'salary': [175.1, 180.2,...
error 信息: AssertionError: Cannot reorder a query once a slice has been taken. 查了一下,是切片后无法重新排序的意思。 关于如何判断是否被切片,在querySet对象(也就是rows)中找到了一个,rows.query.high_mark。如果没有被排序过,它是None,否则是相应的数字。另外这里头还有一个rows.query.low_mark,不过...