"_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",