Pandas is such a unique learning experience. It's the only tool where my mental model changes substantively every time I use it. Yet, I find Pandas hard to "properly" learn because all the tutorials are boring stock market examples.
-
Show this thread
-
There's infinite cases where I can articulate the high-level task, and have no idea how to accomplish it without a for loop & iterrows.
2 replies 0 retweets 1 likeShow this thread -
Replying to @wcrichton
out if curiosity, have you tried taking the tasks you do with for loop and iterrows and tried to translate them into something more "pandas native"?
1 reply 0 retweets 0 likes -
Replying to @drin_montana @wcrichton
My knee jerk is that you probably want to break up operations instead of doing them all at once. like, maybe you're using a for loop to accumulate into variables, but you could make new columns and then aggregate them; something like that
1 reply 0 retweets 0 likes -
Replying to @drin_montana
The iterrows is a bit of an exaggeration. These days, it's usually -- I can't figure out a simple thing with a multi-index, so I do a complicated thing with a flat table. In the outlier example, I couldn't figure out broadcasting semantics between tables of different sizes.
1 reply 0 retweets 0 likes -
Replying to @wcrichton @drin_montana
Come to think of it, 99% of my ongoing confusion usually arises from hierarchy and groups. Everything else is relatively easy (given past experience w/ SQL and functional list APIs).
1 reply 0 retweets 0 likes -
Replying to @wcrichton
ah, this I can relate to, because that stuff confuses me even after looking at the examples and the docs for a long time. the behavior just doesn't seem to fit into my mental model at all.
1 reply 0 retweets 0 likes
I think there would be massive value in automatic contextualization of a tutorial. The pandas multi-index doc is hard to parse because it's full of "foo/bar/baz/quux" random data. But if the data were familiar to me, maybe that would be easier?
-
-
Replying to @wcrichton
that makes me feel like examples could benefit from a madlibs type approach to contextualization. or at least that writing that could be fun.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
cognitive psychology. PhD