• <tfoot id='nUedW'></tfoot>
  • <legend id='nUedW'><style id='nUedW'><dir id='nUedW'><q id='nUedW'></q></dir></style></legend>
    1. <i id='nUedW'><tr id='nUedW'><dt id='nUedW'><q id='nUedW'><span id='nUedW'><b id='nUedW'><form id='nUedW'><ins id='nUedW'></ins><ul id='nUedW'></ul><sub id='nUedW'></sub></form><legend id='nUedW'></legend><bdo id='nUedW'><pre id='nUedW'><center id='nUedW'></center></pre></bdo></b><th id='nUedW'></th></span></q></dt></tr></i><div id='nUedW'><tfoot id='nUedW'></tfoot><dl id='nUedW'><fieldset id='nUedW'></fieldset></dl></div>

      <small id='nUedW'></small><noframes id='nUedW'>

        • <bdo id='nUedW'></bdo><ul id='nUedW'></ul>

      1. statsmodels汇总到乳胶

        statsmodels summary to latex(statsmodels汇总到乳胶)
            <bdo id='MTfXD'></bdo><ul id='MTfXD'></ul>

            <tfoot id='MTfXD'></tfoot>

          • <i id='MTfXD'><tr id='MTfXD'><dt id='MTfXD'><q id='MTfXD'><span id='MTfXD'><b id='MTfXD'><form id='MTfXD'><ins id='MTfXD'></ins><ul id='MTfXD'></ul><sub id='MTfXD'></sub></form><legend id='MTfXD'></legend><bdo id='MTfXD'><pre id='MTfXD'><center id='MTfXD'></center></pre></bdo></b><th id='MTfXD'></th></span></q></dt></tr></i><div id='MTfXD'><tfoot id='MTfXD'></tfoot><dl id='MTfXD'><fieldset id='MTfXD'></fieldset></dl></div>

            1. <small id='MTfXD'></small><noframes id='MTfXD'>

                <legend id='MTfXD'><style id='MTfXD'><dir id='MTfXD'><q id='MTfXD'></q></dir></style></legend>
                  <tbody id='MTfXD'></tbody>

                • 本文介绍了statsmodels汇总到乳胶的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我是 latex 新手,我想将 statsmodels(python-package) 摘要导入到我的乳胶报告.我发现可以使用以下方法将摘要转换为乳胶表格:latex_as_tabular.到目前为止,一切正常.现在我必须存储表格,但我不太明白它是如何工作的.

                  I'm a newbie to latex and I want to import a statsmodels(python-package) summary to my report in latex. I found that it's possible to transform a summary into a latex tabular with the following method: latex_as_tabular. Until now everything is working. Now I have to store the tabular, but I don't really understand how this works.

                  我想我必须使用以下命令:

                  I suppose I have to use the following commands:

                  x_values=sm.add_constant(x_values)
                  model=sm.OLS(y_values, x_values)
                  results=model.fit()
                  tbl=results.summary(xname=['b,'a'],yname='y')
                  with open('c:/temp/temp.tex','w') as fh:
                      fh.write( tbl.as_latex_tabular() )
                  

                  此代码直到现在才起作用.大多数情况下,控制台都会给出错误:tex-file does not exist or not allowed in this map.我真的不明白我必须在这里做什么.有人可以帮我吗?

                  this code doesn't work until now. most of the times the console gives the error: tex-file doesn't exists or not permitted in this map. I don't really understand what I have to do here. Could someone please help me with this ?

                  推荐答案

                  这好像是个误会.您可以通过 summary.as_latex() 或通过调用 table.as_latex_tabular().

                  That seems to be a misunderstanding. You can either convert a whole summary into latex via summary.as_latex() or convert its tables one by one by calling table.as_latex_tabular() for each table.

                  以下示例代码取自 statsmodels 文档.请注意,您不能在 summary 对象上调用 as_latex_tabular.

                  The following example code is taken from statsmodels documentation. Note that you cannot call as_latex_tabular on a summary object.

                  import numpy as np
                  import statsmodels.api as sm
                  
                  nsample = 100
                  x = np.linspace(0, 10, 100)
                  X = np.column_stack((x, x**2))
                  beta = np.array([1, 0.1, 10])
                  e = np.random.normal(size=nsample)
                  
                  X = sm.add_constant(X)
                  y = np.dot(X, beta) + e
                  
                  model = sm.OLS(y, X)
                  results = model.fit()
                  
                  # do either
                  print(results.summary().as_latex())
                  
                  # alternatively
                  for table in results.summary().tables:
                      print(table.as_latex_tabular())
                  

                  这篇关于statsmodels汇总到乳胶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)
                  Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)
                  Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)
                  Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)
                  Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)
                  Grouping pandas DataFrame by 10 minute intervals(按10分钟间隔对 pandas 数据帧进行分组)
                  • <bdo id='P9yxB'></bdo><ul id='P9yxB'></ul>

                    <small id='P9yxB'></small><noframes id='P9yxB'>

                      1. <tfoot id='P9yxB'></tfoot>
                        <i id='P9yxB'><tr id='P9yxB'><dt id='P9yxB'><q id='P9yxB'><span id='P9yxB'><b id='P9yxB'><form id='P9yxB'><ins id='P9yxB'></ins><ul id='P9yxB'></ul><sub id='P9yxB'></sub></form><legend id='P9yxB'></legend><bdo id='P9yxB'><pre id='P9yxB'><center id='P9yxB'></center></pre></bdo></b><th id='P9yxB'></th></span></q></dt></tr></i><div id='P9yxB'><tfoot id='P9yxB'></tfoot><dl id='P9yxB'><fieldset id='P9yxB'></fieldset></dl></div>
                          <tbody id='P9yxB'></tbody>
                        <legend id='P9yxB'><style id='P9yxB'><dir id='P9yxB'><q id='P9yxB'></q></dir></style></legend>