Commit 86cce8ce authored by Toby Hodges's avatar Toby Hodges

Merge branch 'marcs_edits' into 'master'

Marcs edits

See merge request grp-bio-it/ITPP!18
parents 158f168c f2b96e64
......@@ -1440,7 +1440,7 @@
"source": [
"_Note that this exercise is optional._ The data that we read in and plotted in the first parts of this chapter was not in the ideal format. This is deliberate, to provide you with practice in choosing appropriate data structures and reading data from a file. Unfortunately, it's also not uncommon to be provided with data in a weird format that can be inconsistent and annoying to read (_parse_) programmatically.\n",
"\n",
"With counts collected across a set of site names, for a set of taxa, it would be more sensibel to store these data in a tabular format. Now that we have gone to the trouble of reading the data in and adding zero counts where appropriate, let's write a new file with the data arranged in a table.\n",
"With counts collected across a set of site names, for a set of taxa, it would be more sensible to store these data in a tabular format. Now that we have gone to the trouble of reading the data in and adding zero counts where appropriate, let's write a new file with the data arranged in a table.\n",
"\n",
"To write a new file, we use the same `open` function that we read the data in with, but with `'w'` as the mode instead of `'r'`. The tabular file should have the structure:\n",
"\n",
......@@ -1459,20 +1459,9 @@
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
"ename": "IndentationError",
"evalue": "expected an indented block (<ipython-input-25-706fe20f1be2>, line 4)",
"output_type": "error",
"traceback": [
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-25-706fe20f1be2>\"\u001b[0;36m, line \u001b[0;32m4\u001b[0m\n\u001b[0;31m sitenames = list(sites.keys())\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mIndentationError\u001b[0m\u001b[0;31m:\u001b[0m expected an indented block\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"outfh.close()\n",
"outfh.write('taxonID\\t')\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment