def pivot_ui(df, outfile_path = "pivottablejs.html", width="100%", height="500"):
# FIXME: we shouldn't hard-code the port here
port = 8888 # get_config().NotebookApp.port
static_path = 'http://localhost:%s' % port
with open(outfile_path, 'w') as outfile:
outfile.write(template % {'div': df.to_csv(),
'static': '%s/static' % static_path})
return IFrame(src=outfile_path, width=width, height=height)
评论列表
文章目录