I have list list like this
[[], ['1.0', '1.0 (proxy)', '1.1', '1.1 (proxy)', '2.0', '2.0 (proxy)', '3.0', '3.0 (proxy)'], ['1.0', '1.0 (proxy)', '1.1', '1.1 (proxy)', '2.0', '2.0 (proxy)', '3.0', '3.0 (proxy)'], ['2.0', '2.0 (proxy)']]
I want to convert this list of lists to dict in a way that float values become key and corresponding string to its value, so {'1.0': '1.0 (proxy)' ....}
when I try to izip it comes as iterator but then error when wrapping with dict.
>>> for item in izip(li):
... print item
...
([],)
(['1.0', '1.0 (proxy)', '1.1', '1.1 (proxy)', '2.0', '2.0 (proxy)', '3.0', '3.0 (proxy)'],)
(['1.0', '1.0 (proxy)', '1.1', '1.1 (proxy)', '2.0', '2.0 (proxy)', '3.0', '3.0 (proxy)'],)
(['2.0', '2.0 (proxy)'],)
>>> for item in izip(li):
... if item:
... print dict(item)
...
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
ValueError: dictionary update sequence element #0 has length 0; 2 is required