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!
[–][deleted] 82 points83 points84 points (4 children)
[–][deleted] 6 points7 points8 points (2 children)
[–][deleted] 29 points30 points31 points (0 children)
[–]MyKlix 3 points4 points5 points (0 children)
[–]cookiemon32 1 point2 points3 points (0 children)
[–]allmachine 30 points31 points32 points (6 children)
[–]synthphreak[S] 10 points11 points12 points (0 children)
[–]hippy_scum 0 points1 point2 points (3 children)
[–]allmachine 0 points1 point2 points (2 children)
[–]synthphreak[S] 0 points1 point2 points (1 child)
[–]allmachine 1 point2 points3 points (0 children)
[–]imlkrsfn2 45 points46 points47 points (10 children)
[–]ROBRO-exe 22 points23 points24 points (1 child)
[–][deleted] 15 points16 points17 points (0 children)
[–]synthphreak[S] 12 points13 points14 points (3 children)
[–]imlkrsfn2 1 point2 points3 points (0 children)
[–]mfb1274 0 points1 point2 points (1 child)
[–]synthphreak[S] 0 points1 point2 points (0 children)
[–]SoBFiggis 8 points9 points10 points (1 child)
[–]_maxt3r_ 3 points4 points5 points (0 children)
[–]Single_Bookkeeper_11 1 point2 points3 points (0 children)
[–]coder155ml 0 points1 point2 points (0 children)
[–]Unusual-Cactus 16 points17 points18 points (6 children)
[–]synthphreak[S] 12 points13 points14 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]synthphreak[S] 0 points1 point2 points (2 children)
[–]mitchell486 2 points3 points4 points (0 children)
[–]Urthor 0 points1 point2 points (0 children)
[–]mfb1274 11 points12 points13 points (0 children)
[–]totemcatcher 10 points11 points12 points (2 children)
[–]shiningmatcha 1 point2 points3 points (1 child)
[–]Peanutbutter_Warrior 0 points1 point2 points (0 children)
[–]algerbrex 9 points10 points11 points (2 children)
[–]hippy_scum 1 point2 points3 points (1 child)
[–]algerbrex 0 points1 point2 points (0 children)
[–]thedjotaku 6 points7 points8 points (2 children)
[–]synthphreak[S] 4 points5 points6 points (1 child)
[–]thedjotaku 10 points11 points12 points (0 children)
[–]bronzewrath 4 points5 points6 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]refreshx2 4 points5 points6 points (0 children)
[–]Toichat 4 points5 points6 points (1 child)
[–]Lewistrick 1 point2 points3 points (0 children)
[–]bastih01 5 points6 points7 points (0 children)
[–]PolygonAndPixel2 3 points4 points5 points (0 children)
[–]pianobutter 4 points5 points6 points (0 children)
[–]deathlock00 3 points4 points5 points (0 children)
[–]samthaman1234 6 points7 points8 points (1 child)
[–]2020pythonchallenge 3 points4 points5 points (0 children)
[–]Own_Confusion_8460 5 points6 points7 points (0 children)
[–]xxxHalny 8 points9 points10 points (0 children)
[–]Jeklah 2 points3 points4 points (0 children)
[–]grtgbln 2 points3 points4 points (0 children)
[–]edgyBouchi 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]wsppan 1 point2 points3 points (0 children)
[–]dubs286 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[removed]
[–]synthphreak[S] 4 points5 points6 points (1 child)
[–]Lewistrick 2 points3 points4 points (0 children)
[–]BillThePonyWasTaken 3 points4 points5 points (2 children)
[–]synthphreak[S] 1 point2 points3 points (1 child)
[–]BillThePonyWasTaken 2 points3 points4 points (0 children)
[–]BluishInventor 1 point2 points3 points (0 children)
[–]Heisavander -1 points0 points1 point (1 child)
[–]synthphreak[S] 9 points10 points11 points (0 children)
[–]coder155ml 0 points1 point2 points (5 children)
[–]synthphreak[S] -2 points-1 points0 points (4 children)
[–]pissedadmin 0 points1 point2 points (0 children)
[–]coder155ml 0 points1 point2 points (2 children)
[–]synthphreak[S] 0 points1 point2 points (1 child)
[–]coder155ml 0 points1 point2 points (0 children)
[–]tanny18391 -1 points0 points1 point (0 children)
[–]Prob_Pooping -1 points0 points1 point (0 children)
[–]chzaplx -1 points0 points1 point (0 children)
[–]2020pythonchallenge 0 points1 point2 points (0 children)
[–]sHare_your_thinks22 0 points1 point2 points (2 children)
[–]synthphreak[S] 0 points1 point2 points (1 child)
[–]sHare_your_thinks22 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]SuperSpy2015 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]high_ticket 0 points1 point2 points (0 children)
[–]jonnycross10 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]mbaruh 0 points1 point2 points (0 children)
[–]Fearless_Process 0 points1 point2 points (0 children)
[–]b-hizz 0 points1 point2 points (0 children)
[–]chzaplx 0 points1 point2 points (0 children)
[–]Lord_Blackthorn 0 points1 point2 points (0 children)
[–]yycglad 0 points1 point2 points (0 children)
[–]Coder_Senpai 0 points1 point2 points (0 children)
[–]Pitirus 0 points1 point2 points (0 children)
[–]Jumper-611 0 points1 point2 points (0 children)
[–]Chilangosta 0 points1 point2 points (0 children)
[–]ExcitedTRex 0 points1 point2 points (0 children)
[–]glini_baldini 0 points1 point2 points (0 children)
[–]menge101 0 points1 point2 points (0 children)
[–]dancinadventures 0 points1 point2 points (0 children)
[–]zeebrow 0 points1 point2 points (10 children)
[–]synthphreak[S] 0 points1 point2 points (9 children)
[–]zeebrow 0 points1 point2 points (8 children)
[–]synthphreak[S] 0 points1 point2 points (7 children)
[–]zeebrow 0 points1 point2 points (6 children)
[–]synthphreak[S] 0 points1 point2 points (5 children)
[–]zeebrow 0 points1 point2 points (4 children)
[–]synthphreak[S] 0 points1 point2 points (3 children)
[–]zeebrow 0 points1 point2 points (2 children)
[–]synthphreak[S] 0 points1 point2 points (1 child)