the case of the dead sand mouse
Various different answers from us as Jupyter Notebook pages you can download. This week is a bonanza of possible answers available for you; in future weeks, we'll focus effort more, and it'll be more like three, two from two chosen TFs each week, and one from me.
No matter what the pythonistas say, there isn't just One Right Way to solve a problem in python. By comparing the different answers, you'll start seeing a range of different approaches and tricks. For example, in comparing the Moriarty and Adler gene name lists for part 1, a naturally pythonic approach is to use set operations, subtracting one set from the other. But you can just as easily iterate over the gene names in one list and test if a gene name is
not in the other list. Python has some very powerful syntax, such as list comprehensions and lambdas (anonymous functions), which is helpful (if you know them) but not necessary (if you don't). You'll see examples of more or less clever syntax here, but all of it's getting the job done.
Sean: My solutions each week will generally be a bare bones example, and this is no exception. I shortcut the data exploration in step (3) by using unix commands, including
sort, inside the Jupyter notebook page.
Daniel: Shows one way to pull copies of data files across the network into your current directory, by calling out to the
curlcommand. Illustrates using Python list comprehensions to write compact statements that iterate over a list, for example to transform it into a new kind of list. Shows a simple example of plotting some data - good for looking ahead to week 3, when we'll start using matplotlib to make plots.
June: Including another way to pull copies of data across the network, calling out to
Kevin: Among other things, shows both set and list approaches for doing part 1.
Michael: Compares solving the problem in bare Python (what we asked for) versus using the Pandas data science module. Also includes some data plotting with matplotlib. Useful to look ahead to week 3 when we'll start using Pandas and matplotlib.
Kate: With good text explanations of what's going on, and explaining a bit how Python's
sorted()function works for sorting lists. Uses "old style" Python printing syntax instead of "new style"... Python's printing syntax has historically been a source of frustration (python2 print is not necessarily compatible with python3). You just have to get used to it.