问题
I want to be able to open a dataframe in a Spyder (Python IDE) window and quickly scroll down to the last record of a relatively large pandas dataframe (134,890 records in table). It's frustrating because Spyder only loads a certain number of records from large tables, and scrolling down takes a while.
Does anyone know a shortcut or option to quickly get to the end of the dataframe, without writing any code like df.tail()?
The following image shows a dataframe with data extending into 2018, but it takes me quite a while to scroll to the end. Every time I scroll to what should be the bottom, Spyder loads a few more records from the table, and I start scrolling down again...
回答1:
(Spyder maintainer here) There's a simpler and much easier way to inspect the end of a Dataframe: pressing with the mouse on the name of the column you want to sort and the Dataframe will be sorted in reverse order if Pandas can do it.
Note: Sorting by index will be available in Spyder 4, to be released by the end of 2018.
回答2:
I think I figured it out. I must keep pulling down on the scroll bar and wiggle it left and right until Spyder has loaded all the records. The key is not to let go of the scroll bar until Spyder has finished loading all the records. If I let go, Spyder will stop loading new records.
来源:https://stackoverflow.com/questions/48547818/how-to-get-to-last-record-of-large-dataframe-in-spyder-window