import sagetex
_st_ = sagetex.SageTeXProcessor('data', version='2015/08/26 v3.0-92d9f7a', version_check=True)
_st_.current_tex_line = 11
_st_.blockbegin()
try:
t = r"""
\begin{tabular}{ll}
col1 & col2 \\
1 & 2 \\
3 & 4 via sagestr
\end{tabular}
"""
except:
_st_.goboom(19)
_st_.blockend()
try:
_st_.current_tex_line = 24
_st_.inline(0, "foo")
except:
_st_.goboom(24)
try:
_st_.current_tex_line = 26
_st_.inline(1, t)
except:
_st_.goboom(26)
_st_.current_tex_line = 30
_st_.blockbegin()
try:
t2 = []
t2.append(r"\begin{tabular}{ll}")
t2.append(r"col1 & col2 \\")
t2.append(r"1 & 2 \\")
t2.append(r"3 & 4")
t2.append(r"\end{tabular}")
t2 = "\n".join(t2)
except:
_st_.goboom(38)
_st_.blockend()
try:
_st_.current_tex_line = 40
_st_.inline(2, t2)
except:
_st_.goboom(40)
_st_.current_tex_line = 44
_st_.blockbegin()
try:
import statsmodels.api as sm
import pandas as pd
ds = sm.datasets.grunfeld.load_pandas()
pt = ds.data[ds.data.year > 1950]\
.pivot_table(\
values=["invest"],\
index=["firm"],\
columns=["year"])
except:
_st_.goboom(53)
_st_.blockend()
try:
_st_.current_tex_line = 61
_st_.inline(3, pt.to_latex())
except:
_st_.goboom(61)
_st_.endofdoc()