我在python中有以下列表:
[
u'aaaaa',
[1, 6, u'testing', 20.0, 18.0, 2.0, 'In time'],
u'zzzzzz',
[1, 6, u'testing', 20.0, 18.0, 2.0, 'In time'],
[1, 1, u'xyz ', 30.0, 25.0, 5.0, 'On Going'],
[2, 1, u'abcd', 10.0, 8.0, 2.0, 'In time'],
u'bbbbb',
[1, 6, u'testing', 20.0, 18.0, 2.0, 'In time'],
[1, 1, u'xyz ', 30.0, 25.0, 5.0, 'On Going'],
[2, 1, u'abcd', 10.0, 8.0, 2.0, 'In time'],
[1, 7, u'develop', 20.0, 15.0, 5.0, 'On Going']
]
我想要以下python输出:
^{pr2}$请建议我如何在python中使用manageorder。在
下面将给出所需的输出。它使用字典来识别重复条目。在
这将产生以下输出:
^{pr2}$使用Python2.7进行测试
更新:如果需要列表格式,只需在上面的脚本中将
[]
添加到item
中,如下所示:这将产生以下输出:
如果要从列表中获取所有唯一值:
1)我真的认为你应该看看Python字典。你看他们的输出会更有意义。在
2)在这种情况下,如果我理解正确,您希望将包含字符串或列表元素的列表转换为列表列表。这个列表列表应该有一个起始元素作为字符串,其余元素作为主列表中的以下列表项,直到找到下一个字符串为止。(至少从你的例子来看是这样的)。在
相关问题 更多 >
编程相关推荐