python-ecology-lesson
python-ecology-lesson copied to clipboard
Repeated explanation of functions
Functions are introduced at the very end of Ep.00, but unused until Ep.05 where they are reintroduced more comprehensively as part of the section dedicated to loops and functions. Should the information about functions in Ep.00 be removed, as it introduces a new concept that isn't in the stated lesson objectives and is treated properly later? Alternatively it could be added to the Ep.00 lesson objectives, and could be given its own challenge?
That's a good point @cbrafter. We discuss functions in the next chapter, but in the sense of loading a library and using pre-existing functions. I think perhaps the best way forward would be to take them out in lesson-00, introduce functions in 01 as pre-existing tools in a library [no change to text], then discuss custom functions in 05. What do you think about that approach? That's a little more in line with how R-ecology is doing it these days, as well.
Note that I'm not committing you to do any of that, just bouncing the idea around;)
I agree with the approach proposed by @wrightaprilm. I think it would also be worthwhile to move this line
Tip: print and type are built-in functions in Python. Later in this lesson, we will introduce methods and user-defined functions. The Python documentation is excellent for reference on the differences between them.
to 05, and include the link to the Python documentation that explains these differences.
Hi everybody! I see the problem, but I have a different suggestion. I agree with moving intro to functions from 00 episode to 01 episode, but add it to section "Useful Ways to View DataFrame objects in Python", where methods are introduced. How I would phrase it is that attributes are descriptions of objects, for example "this cat is black" and methods are small functions that require more lines of code, for example how much weight this cat lost weight in kg since last vet visit".
OK, so for those following along at home, here are the proposals:
- [ ] Remove references to functions in lesson 00.
- [ ] Add a definition of a method, since we use that term
- [ ] Move custom definitions to 05.
Does that sound right? Let me know if it doesn't - I'll amend the checklist. Any one of these items would be a good instructor training checkout exercise.
I will make this a part of my instructor checkout ;)
Hi @pinsleepe, I wanted to check in if you still intend to get to this, or if I can mark it as up-for-grabs for the Bug BBQ. Either way is totally fine. Thanks!
I think explaining and using build in function should be introduced in the introduction, but how to write own functions is more advanced and should only come later or dropped from the lesson (the R lesson for example does not introduce functions at all) I just added a pull-request #260 with a rewritten introduction which does not include the self defined function anymore
Closed together with #260