I have a data like this in Pandas dataframe
id import_id investor_id loan_id meta
35736 unremit_loss_100312 Q05 0051765139 {u'total_paid': u'75', u'total_expense': u'75'}
35737 unremit_loss_100313 Q06 0051765140 {u'total_paid': u'77', u'total_expense': u'78'}
35739 unremit_loss_100314 Q06 0051765141 {u'total_paid': u'80', u'total_expense': u'65'}
How to sort based on total_expense which is value of json field
ex: total_expense on meta field
Output should be
id import_id investor_id loan_id meta
35739 unremit_loss_100314 Q06 0051765141 {u'total_paid': u'80', u'total_expense': u'65'}
35736 unremit_loss_100312 Q05 0051765139 {u'total_paid': u'75', u'total_expense': u'75'}
35737 unremit_loss_100313 Q06 0051765140 {u'total_paid': u'77', u'total_expense': u'78'}
df = df.iloc[df['meta'].str.get('total_expense').argsort().values, :]and see if that works. If not, you will need to show us more than 1 row of data.