小编Raz*_*azz的帖子

如何在Python中对字典列表(使用浮点值字段)进行排序?

我在 Python 的字典列表中有这组值。

[
{'dep_price': '42.350', 'dep_date': '8-Mar-2017', 'trip_type': 'dep'}, 
{'dep_price': '42.350', 'dep_date': '9-Mar-2017', 'trip_type': 'dep'}, 
{'dep_price': '36.350', 'dep_date': '10-Mar-2017', 'trip_type': 'dep'}
]
Run Code Online (Sandbox Code Playgroud)

如何根据字段“dep_price”作为浮点值对它们进行排序?

python sorting floating-point

-2
推荐指数
1
解决办法
2103
查看次数

标签 统计

floating-point ×1

python ×1

sorting ×1