【发布时间】:2018-06-07 07:34:31
【问题描述】:
我正在处理一组数据。我们如何从这个 DataFrame 中提取“价值”?谢谢。
这是数据框:
distance duration status
0 {'text': '0.5 km', 'value': 532} {'text': '8 mins', 'value': 452} OK
1 {'text': '0.7 km', 'value': 682} {'text': '9 mins', 'value': 561} OK
2 {'text': '0.6 km', 'value': 646} {'text': '9 mins', 'value': 539} OK
3 {'text': '0.3 km', 'value': 301} {'text': '4 mins', 'value': 219} OK
4 {'text': '0.3 km', 'value': 339} {'text': '5 mins', 'value': 307} OK
5 {'text': '0.4 km', 'value': 418} {'text': '6 mins', 'value': 357} OK
6 {'text': '0.5 km', 'value': 537} {'text': '7 mins', 'value': 436} OK
7 {'text': '0.4 km', 'value': 434} {'text': '6 mins', 'value': 367} OK
8 {'text': '0.4 km', 'value': 394} {'text': '6 mins', 'value': 341} OK
【问题讨论】:
-
您期望的输出格式是什么?
-
这是熊猫数据框吗?如果是这样,则应相应地标记问题。
-
@user3664111 - 你试过我的解决方案了吗?
标签: python-3.x dataframe extraction