Sort a dataframe in which one column contains nan values

Published: 12/06/2019
Sort a dataframe in which one column contains nan values
Source: STACKOVERFLOW.COM

I have a dataframe. Item Type Year_Month Total Cost Diff Baby Food Jul-2017 3000 100 Baby Food Jun-2017 2900 100 Cereal Jul-2017 6000 1000 Cereal Jun-2017 5000 1000 Snacks Jul-2017 4500 Nan Chocolates Jul-2017 3000 Nan Ice Cream Jul-2017 4000 Nan I want to sort the dataframe based on diff but when it contains Nan in that case it should sort according to Total Cost. So my final output will look lik

Read more
Related news
Comment
FACEBOOK