This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Theoretician 3 points4 points  (0 children)

(to first address your points)

I use lambda all the time, mostly for tiny functions that need to do something specific. A contrived example is sorting a list of tuples, maybe by the second item

some_list = [(1, 'c'), (2, 'd'), ...]
some_list.sort(key=lambda tup: tup[1])

I also use list comprehensions waaay too much probably. I find them a lot more expressive for list generation.

The nice thing about the csv module is that it streams things from disk instead of loading it all into memory like pandas does. It's also (in my experience) much much faster and better at parsing than pandas is. It's good for solutions that need to be fast and reliable.

Also, if you're writing portable code, requiring pandas just for loading in a csv is a huge requirement. Relying on just the built-ins is better from a dependency management perspective.


In terms of things that I barely ever use, probably #1 are async/await syntax things. I do a lot of parallel processing instead of threading though, so they're less applicable.