News for hackers. Stuff that matters.
Re:Self-Directed Pandas Crash Course by jzwinck on Saturday February 06, 2021 @07:33PM (#26051522)
Here are two options which various people might find intuitive:

1. Make a good old numeric for loop like "for ii in range(len(df))" with df.iloc or df.ix, etc.

2. Use df.apply() to create a new DataFrame with your changes.

Both of these are mentioned in brief answers to that SO post. But not in the accepted answer. A lot of the answers focus on the most efficient ways to do things, even though the question was very basic and did not imply the data were large.

Re:Self-Directed Pandas Crash Course by smabie on Sunday February 07, 2021 @12:47AM (#26052961)
It's not even about performance, writing vectorized code is just superior. The array language model is very powerful and you can literally write a couple lines of code that would take hundreds of lines of normal Python.

That being said, Pandas isn't a very good array language. I really like kdb+/q and find it better and more expressive than almost any other language I've used.