r/learnpython • • Apr 16 '21

I am a proficient Python coder whose learning has plateaued. Any really useful libraries I should look into learning? Taking recommendations.

Machine learning engineer here. I love learning Python, but I'm already quite proficient, so my learning has plateaued lately. I can pretty much do whatever I need to without difficulty.

That said, Python is vast. It's totally possible that there are great tools out there which could help me improve further, and I've just never heard of them. For example, I used to think I'd seen it all, then I learned about itertools, and that was a game-changer. It helped me greatly simplify code that I had originally thought was as simple as it could get. It was exhilarating.

So what I'm looking for are things like that, general purpose utilities that can help keep code clean and efficient, and/or provide ready-made objects for common operations. Nice little nuggets like itertools.groupby, or functools.reduce, or collections.namedtuple. Why write some convoluted function to tally the elements in an array when collections.Counter does it for you in one line? Why spell out an item-getting operation explicitly every time when I could just use operator.itemgetter to define it in one place and use that everywhere else? Little niceties like these can improve your code a lot but have to be discovered, and I just feel like I haven't discovered any in a long time.

Non-niche (meaning non-ML-specific) libraries I already use very often include:

  • argparse

  • collections

  • itertools

  • json

  • logging / loguru

  • matplotlib

  • numpy

  • pandas

  • pathlib

  • random

  • re

  • sys

... there are doubtless others, but that's all I can think of for now. Am I missing any major players? Bonus point if they're already in the standard library!

Edit: If you can also provide a short one-liner about what each package does/is for/how you use it/why you're including it/etc., rather than just a bulleted list of package names, that would be extra useful in helping me to prioritize. Thanks again guys, this is great, keep 'em coming!

344 Upvotes

110 comments sorted by

View all comments

Show parent comments

1

u/synthphreak Jul 01 '21

🤔

1

u/zeebrow Jul 01 '21

What the fuck did you just fucking say about me, you little bitch? I'll have you know I graduated top of my class in the Navy Seals, and I've been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills. I am trained in gorilla warfare and I'm the top sniper in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of spies across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You're fucking dead, kid. I can be anywhere, anytime, and I can kill you in over seven hundred ways, and that's just with my bare hands. Not only am I extensively trained in unarmed combat, but I have access to the entire arsenal of the United States Marine Corps and I will use it to its full extent to wipe your miserable ass off the face of the continent, you little shit. If only you could have known what unholy retribution your little "clever" comment was about to bring down upon you, maybe you would have held your fucking tongue. But you couldn't, you didn't, and now you're paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it. You're fucking dead, kiddo.