TU-Coding-Outreach-Group / cog_summer_workshops_2022

Creative Commons Zero v1.0 Universal
9 stars 8 forks source link

data wrangling - piping breakdown #6

Closed hspopal closed 2 years ago

hspopal commented 2 years ago

I think we should explain piping a bit more. I liked Billy's example where he wrote a simple nested function and then showed how it would be down with piping. Kind of like exercise one, but maybe it will be helpful to include a simple one in the beginning with simple math (e.g. take the square root, then plot in a histogram).

wj-mitchell commented 2 years ago

Great suggestion Haroon. I adding a little bit of a background about pipes and used a demonstration where I take a random sample, get the mean of it, log it, and then round it, and I showed three progressively better ways of approaching this problem, ultimately culminating in piping, which I think demonstrates the utility.