Why does my Pandas DataFrame not display new order using `sort_values`?

前端 未结 2 1923
广开言路
广开言路 2020-11-27 07:05

New to Pandas, so maybe I\'m missing a big idea? I have a Pandas DataFrame of register transactions with shape like (500,4):

Time                       


        
2条回答
  •  醉话见心
    2020-11-27 07:31

    My problem, fyi, was that I wasn't returning the resulting dataframe, so PyCharm wasn't bothering to update said dataframe. Naming the dataframe after the return keyword fixed the issue.

    Edit: I had return at the end of my method instead of return df, which the debugger must of noticed, because df wasn't being updated in spite of my explicit, in-place sort.

提交回复
热议问题