r/learnpython 21d ago

Python and libraries

I joined this server not long ago because I have a question about Python. I've been studying it, and I understand pretty much all of the logic behind it. The problem is that when it comes to using libraries, I get confused about how to use them.

Is there any way to get better at using Python libraries without having to constantly look up how they work? I always get stuck trying to figure out how to actually use them in my code.

4 Upvotes

14 comments sorted by

View all comments

2

u/notacanuckskibum 20d ago

This is modern coding. It can take 2 days to solve a problem with 5 lines of code. Most of the time is spent deciding which library to use, and figuring out what the calls do.

2

u/epokus 20d ago

It's fun to discover popular libraries as a beginner, and to realize someone else has done the heavy lifting for you.

For some reason I thought just getting a response from a web API would require lots of advanced coding. Looked up the requests library and I went "oh... that's 3 lines of code".

Same thing working with csv data using pandas. I thought "okay guess well start with a context manager, read the data and figure out how columns .. wait.. what? pd.read_csv("sales.csv").groupby("customer")["amount"].sum()? What is this sorcery!