datacarpentry / python-ecology-lesson

Data Analysis and Visualization in Python for Ecologists
https://datacarpentry.org/python-ecology-lesson
Other
160 stars 310 forks source link

Answers to challenges? #542

Closed wood-chris closed 1 year ago

wood-chris commented 1 year ago

As an instructor, I find it useful that (most of) the Software Carpentry episodes include answers to their challenges - it might describe things in ways that are different to the way I would (which might be helpful to some learners), or help me realise the point of a challenge, which might not always be clear just from the question. Is the lack of answers to some challenges in the this lesson a conscious decision, a lack of time, or something else?

One particular example is https://datacarpentry.org/python-ecology-lesson/02-starting-with-data/index.html#challenge---make-a-list; I'm not sure what the right answer is meant to be, and the question confuses me a little bit. A list of the species could be constructed by

list(species_df.groupby("species_id").count())

but the question asks about the associated counts too, so should the answer be a dictionary? i.e.

dict(species_df.groupby("species_id")["record_id"].nunique())

Or, is there an alternative method - is the hint of using min() meant to be suggest learners use that function, or just an example that many functions can be called on an object of type pandas.core.groupby.generic.DataFrameGroupBy?

tobyhodges commented 1 year ago

Hi @wood-chris, I will jump in because this question is particularly relevant to my work right now.

For historical reasons I am honestly not entirely clear on myself, solutions to challenges in this lesson are located in the Instructor Notes page of the lesson site. Next month, The Carpentries will be coordinating a community-wide effort to update Instructor Notes across all of its lessons - the Instructor Notes Drive - and, during that, I will be encouraging community members to open pull requests to relocate the solutions from that page into the individual episodes.

As you say, this will make it more consistent with other lessons, and IMO will also make that Instructor Notes page more useful.

wood-chris commented 1 year ago

@tobyhodges thanks for the reply! Ah, I should have looked harder for the answers! Thanks for highlighting it though and the info about the upcoming updates

tobyhodges commented 1 year ago
tobyhodges commented 1 year ago

I have finished making the PRs to resolve this issue.

@btovar @LilithElina because I made one PR per episode, some merge conflicts may arise if and when you start merging them. I am not going to be online tomorrow, but will keep an eye on my GitHub notifications once I am back at my desk, and try to resolve conflicts ASAP when they come up.

btovar commented 1 year ago

@tobyhodges Only #555 had a conflict. Thanks for all this work!

tobyhodges commented 1 year ago

I have resolved the conflicts on #555 and I think it's ready to merge.

One more PR incoming to move some of the remaining Instructor Notes inline... [Edit: here it is #560]

tobyhodges commented 1 year ago

@wood-chris thanks to @btovar for reviewing and merging. I think this can be closed now.

btovar commented 1 year ago

@tobyhodges thanks for all your work!