{"0":{"sortindex":0,"updateuser":"xx"},"1":{"sortindex":0,"updateuser":"xx"},"2":{"sortindex":0,"updateuser":"xx"}} 将上述字符串转为List<Map>
时间: 2023-12-15 16:32:47 浏览: 55
Python数据归一化的KNN算法.zip
您可以使用Python中的json库将该字符串转换为List<Map>。具体代码如下所示:
```python
import json
# 定义字符串
str_data = '{"0":{"sortindex":0,"updateuser":"xx"},"1":{"sortindex":0,"updateuser":"xx"},"2":{"sortindex":0,"updateuser":"xx"}}'
# 将字符串转换为List<Map>
list_data = json.loads(str_data)
# 输出转换后的结果
print(list_data)
```
输出结果为:
```
{'0': {'sortindex': 0, 'updateuser': 'xx'}, '1': {'sortindex': 0, 'updateuser': 'xx'}, '2': {'sortindex': 0, 'updateuser': 'xx'}}
```
阅读全文