Pandas has use cases, but i see it sooo much overused for no reason.<p>People automatically think "csv? I gotta install Pandas!" even if CSV is like 20 lines long. Then follows 15 lines of Pandas DSL that i have to decipher to modify anything<p>I hate it
The Python interpreter as acting totally sanely.<p>The author is asking it to loop over a list (or any iterable) and destructure each of the <i>elements</i>. But is then providing a a list containing some strings, none of which can be destructured.<p>Reducing to just the second part of the loop:<p><pre><code> [(x, z) for x, _, z, *_ in ["0x2d41854", "3", "0x80001a14", "(0xbffd)"]]
</code></pre>
IE in non-list-comprehension form:<p><pre><code> for x, _, z, *_ in ["0x2d41854", "3", "0x80001a14", "(0xbffd)"]:
</code></pre>
IE, the first element is expanded as:<p><pre><code> x, _, z, *_ = "0x2d41854"
</code></pre>
Which is clearly nonsensical.
the bug is the diy csv loader. use instead the csv module or its equivalent. My experience parsing csv's (how hard can it be?) often end with nested lists of iterators, complex logic to deal with edge cases, and other things that fail on painful-to-diagnose corner cases - exactly like what the author describes.
I found the mistake obvious, but I have some experience with Python.<p>The use of the `for ... in [...]` to destructure the list is quite clever.<p>I would have simply indexed the list.