Pandas is cancer. Please stop teaching it to people. Everything it does can be done reasonable well with list comprehensions and objects that support type annotations and runtime type checking (if needed). Pandas code is untestable, unreadable, hard to refactor and impossible to reuse. Trillions of dollars are wasted every year by people having to rewrite pandas code.
Python Data Science Handbook
51–60 of 67 posts
Re: Python Data Science Handbook
#52Pandas is cancer. Please stop teaching it to people. Everything it does can be done reasonable well with list comprehensions and objects that support type annotations and runtime type checking (if needed). Pandas code is untestable, unreadable, hard to refactor and impossible to reuse. Trillions of dollars are wasted every year by people having to rewrite pandas code.
Re: Python Data Science Handbook
#53Interesting choice of Pandas in this day and age. Maybe he’s after imparting general concepts that you could apply to any tabular data manipulator rather than selecting for the latest shiny tool.
What's wrong with Pandas?
Re: Python Data Science Handbook
#54Interesting choice of Pandas in this day and age. Maybe he’s after imparting general concepts that you could apply to any tabular data manipulator rather than selecting for the latest shiny tool.
It was originally published in 2016, and I think this is still the first edition.
> Copyright 2016
Re: Python Data Science Handbook
#55Pandas is cancer. Please stop teaching it to people. Everything it does can be done reasonable well with list comprehensions and objects that support type annotations and runtime type checking (if needed). Pandas code is untestable, unreadable, hard to refactor and impossible to reuse. Trillions of dollars are wasted every year by people having to rewrite pandas code.
That said, the polars/narwals style API is better than pandas API for sure. More readable and composable, simpler (no index) and a bit less weird overall.
Re: Python Data Science Handbook
#56Earlier quoted context omitted.
I probably wouldn’t rewrite an entire data science stack that used pandas, but most people would use polars if starting a new project today.
R and Matlab workflows have been fairly stable for the past decade. Why is the Python ecosystem so... unstable? It puts me off investing any time in it.
Re: Python Data Science Handbook
#57Pandas is cancer. Please stop teaching it to people. Everything it does can be done reasonable well with list comprehensions and objects that support type annotations and runtime type checking (if needed). Pandas code is untestable, unreadable, hard to refactor and impossible to reuse. Trillions of dollars are wasted every year by people having to rewrite pandas code.
Code using pandas is testable and reusable in much the same way as any other code, make functions that take and return data. That said, the polars/narwals style API is better than pandas API for sure. More readable and composable, simpler (no index) and a bit less weird overall.
Re: Python Data Science Handbook
#58[flagged]
Re: Python Data Science Handbook
#59Pandas is cancer. Please stop teaching it to people. Everything it does can be done reasonable well with list comprehensions and objects that support type annotations and runtime type checking (if needed). Pandas code is untestable, unreadable, hard to refactor and impossible to reuse. Trillions of dollars are wasted every year by people having to rewrite pandas code.
I've recently had to migrate over to Python from Matlab. Pandas has been doing my head in. The syntax is so unintuitive. In Matlab, everything begins with a `for` loop. Inelegant and slow, yes, but easy to reason about. Easy to see the scope and domain of the problem, to visualise the data wrangling. Pandas insist you never use a for loop. So, I feel guilty if I ever need a throwaway variable on the way to creating a…
I pretty much consider anyone who likes it to have Stockholm syndrome.
Re: Python Data Science Handbook
#60Earlier quoted context omitted.
R and Matlab workflows have been fairly stable for the past decade. Why is the Python ecosystem so... unstable? It puts me off investing any time in it.
The R ecosystem has had a similar evolution with the tidyverse, it was just a little further ago. As for Matlab, I initially learned statistical programming with it a long time ago, but I’m not sure I’ve ever seen it in the wild. I don’t know what’s going on there. I’m actually quite partial to R myself, and I used to use it extensively back when quick analysis was more valuable to my career. Things have probably pro…
Yes, there is Octave but often the toolboxes aren't available or compatible so you're rewriting everything anyway. And when you start rewriting things for Octave you learn/remember what trash Matlab actually is as a language or how big a pain doing anything that isn't what Mathworks expects actually is.
To be fair: Octave has extended Matlab's syntax with amazing improvements (many inspired by numpy and R). It really makes me angry that Mathworks hasn't stolen Octave's innovations and I hate every minute of not being able to broadcast and having to manually create temp variables because you can't chain indexing whenever I have to touch actual Matlab. So to be clear Octave is somewhat pleasant and for pure numerical syntax superior to numpy.
But the siren call of Python is significant. Python is not the perfect language (for anything really) but it is a better-than-good language for almost everything and it's old enough and used by so many people that someone has usually scratched what's itching already. Matlab's toolboxes can't compete with that.