datacarpentry / python-ecology-lesson

Data Analysis and Visualization in Python for Ecologists

Home Page:https://datacarpentry.org/python-ecology-lesson

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Answers to challenges?

wood-chris opened this issue · comments

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?

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.

@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

  • 00-before-we-start.md (no challenges in this episode)
  • 01-short-introduction-to-Python.md
  • 02-starting-with-data.md
  • 03-index-slice-subset.md
  • 04-data-types-and-format.md
  • 05-merging-data.md
  • 06-loops-and-functions.md
  • 07-visualization-ggplot-python.md (solutions were already present in this episode)
  • 08-putting-it-all-together.md (solutions were already present where possible in this episode)
  • 09-working-with-sql.md

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.

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

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]

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

@tobyhodges thanks for all your work!