相关疑难解决方法(0)

如何展开输出显示以查看更多列?

有没有办法在交互式或脚本执行模式下扩大输出显示?

具体来说,我在Pandas上使用describe()函数describe().当DataFrame5列(标签)宽时,我得到了我想要的描述性统计数据.但是,如果DataFrame有更多列,则会抑制统计信息并返回类似的内容:

>> Index: 8 entries, count to max  
>> Data columns:  
>> x1          8  non-null values  
>> x2          8  non-null values  
>> x3          8  non-null values  
>> x4          8  non-null values  
>> x5          8  non-null values  
>> x6          8  non-null values  
>> x7          8  non-null values  
Run Code Online (Sandbox Code Playgroud)

无论是否有6列或7列,都给出"8"值."8"是指什么?

我已经尝试将IDLE窗口拖大,以及增加"配置IDLE"宽度选项,但无济于事.

我使用Pandas和describe()的目的是避免使用像STATA这样的第二个程序来进行基本的数据操作和调查.

Python/IDLE 2.7.3
Pandas 0.8.1
Notepad ++ 6.1.4(UNICODE)
Windows Vista SP2

python printing column-width pandas

526
推荐指数
15
解决办法
53万
查看次数

Pandas to_html() truncates string contents

I have a Python Pandas DataFrame object containing textual data. My problem is, that when I use to_html() function, it truncates the strings in the output.

For example:

import pandas
df = pandas.DataFrame({'text': ['Lorem ipsum dolor sit amet, consectetur adipiscing elit.']})
print (df.to_html())
Run Code Online (Sandbox Code Playgroud)

The output is truncated at adapis...

<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>text</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td> Lorem ipsum dolor sit amet, consectetur adipis...</td>
    </tr>
  </tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

There is a related question on …

html python pandas

71
推荐指数
2
解决办法
2万
查看次数

标签 统计

pandas ×2

python ×2

column-width ×1

html ×1

printing ×1