Notebook
sums[2015]['Northern NO3']=1 sums[2015]['Northern NH4']=1 sums[2015]['Northern PON']=1 sums[2015]['Northern DON']=1 sums[2015]['Northern Living']=1 sums[2016]['Northern NO3']=1 sums[2016]['Northern NH4']=1 sums[2016]['Northern PON']=1 sums[2016]['Northern DON']=1 sums[2016]['Northern Living']=1
sums[2016].keys() lines=list() lines.append(r' \small'+'\n') lines.append(r' \centering'+'\n') lines.append(r' \begin{tabular}{lccc}\toprule'+'\n') lines.append(r' & 2015 & 2016 & 2017 \\ \midrule'+'\n') lines.append(r' {} & {} & {} & {} \\'.format('Primary Production', sums[2015]['NO3-based Primary Production']+sums[2015]['NH4-based Primary Production'], sums[2016]['NO3-based Primary Production']+sums[2016]['NH4-based Primary Production'], sums[2017]['NO3-based Primary Production']+sums[2017]['NH4-based Primary Production'])+'\n') lines.append(r' ${}$ & {} & {} & {} \\'.format(' NO_3-based', sums[2015]['NO3-based Primary Production'], sums[2016]['NO3-based Primary Production'], sums[2017]['NO3-based Primary Production'])+'\n') lines.append(r' ${}$ & {} & {} & {} \\'.format('NH_4-based', sums[2015]['NH4-based Primary Production'], sums[2016]['NH4-based Primary Production'], sums[2017]['NH4-based Primary Production'])+'\n') lines.append(r' \midrule'+'\n') lines.append(r' \\ \\') lines.append(r' \end{tabular}'+'\n') f = open('fluxesTBL.tex', 'w') f.writelines(lines) f.close()