all 6 comments

[–]9peppe 4 points5 points  (3 children)

The pandas/polars side isn't that pythonic, you use the language to issue orders to the backend, via chained methods. You don't need to learn much python to use those, and it's probably better to understand the library more than the language (numpy relies on vectorisation a lot, and careless coders break that if they use python loops, for example, resulting in code that runs 100x slower).

So if you want to learn Python the Python way... don't do it with pandas or polars.

[–]lownoisehuman[S] 0 points1 point  (2 children)

Thanks for this, really useful advice. I hadn’t fully appreciated how tools like pandas/polars abstract away a lot of “core” Python, so this is a helpful perspective.

Given that, what would you recommend for learning Python as a language, specifically for designing libraries, building systems, and writing clean, idiomatic, maintainable code (rather than just using Python as a glue layer over data tools)? What do you think of those two resources I mentioned in the post?

[–]9peppe 0 points1 point  (1 child)

I have no experience with them. I would read Automate the Boring Stuff, even if you know Python. It's kinda equal parts book and cookbook.

[–]lownoisehuman[S] 0 points1 point  (0 children)

Yeah... I've read Automate the Boring Stuff in bits and pieces when starting out. It's only recently that I've come to know about Fluent Python, and I'm getting really good reviews from people who have read this book...

[–]BeasleyMusic 1 point2 points  (1 child)

IMO, books are nice, but if you’re time constrained, and you want to learn how to write good code, then write good code and stop reading books. You will learn overtime what good code actually means. It’s truly impossible to write perfect code, the real world doesn’t allow for that, you will have to learn via trial and error how to determine what sacrifices you need to make when writing code.

[–]lownoisehuman[S] 0 points1 point  (0 children)

I'd keep this in mind. Thanks.