2017-04-22 17 views
0

테이블의 모든 행을 인쇄하고 싶습니다. "stat_data"목록에 콘솔에 인쇄 할 항목이 323 개 있습니다.테이블의 모든 행을 인쇄하십시오.

이렇게하려면 아래 코드를 사용하십시오.

from astropy.table import Table, Column 
t = Table(rows=stat_data, names=('Redacted Term', 'Length', 'File', 'Type')) 
print(t) 

그러나 모든 행을 인쇄하는 것이 아니라 일부 행만 인쇄합니다. 모든 행을 인쇄 할 수있게 도와주세요. 위의 코드의

출력은 테이블에

Redacted Term Length    File    Type 
    ------------- ------ ---------------------------- ------ 
    Trump  5      1.html names 
    4909090909  10 otherfiles/sample-output.txt phones 
    3235294117  10 otherfiles/sample-output.txt phones 
    5957446808  10 otherfiles/sample-output.txt phones 
    8518518518  10 otherfiles/sample-output.txt phones 
    3255813953  10 otherfiles/sample-output.txt phones 
    5227272727  10 otherfiles/sample-output.txt phones 
    3076923076  10 otherfiles/sample-output.txt phones 
    0555555555  10 otherfiles/sample-output.txt phones 
    5384615384  10 otherfiles/sample-output.txt phones 
    4210526315  10 otherfiles/sample-output.txt phones 
    7777777777  10 otherfiles/sample-output.txt phones 
    3181818181  10 otherfiles/sample-output.txt phones 
    5869565217  10 otherfiles/sample-output.txt phones 
    1153846153  10 otherfiles/sample-output.txt phones 
    4347826086  10 otherfiles/sample-output.txt phones 
    2043010752  10 otherfiles/sample-output.txt phones 
    8260869565  10 otherfiles/sample-output.txt phones 
    6315789473  10 otherfiles/sample-output.txt phones 
    4583333333  10 otherfiles/sample-output.txt phones 
     ... ...       ... ... 
    William  7    otherfiles/a.txt names 
    Mastrosimone  12    otherfiles/a.txt names 
    William  7    otherfiles/a.txt names 
    Tell  4    otherfiles/a.txt names 
    Oveture  7    otherfiles/a.txt names 
    Gioachino  9    otherfiles/a.txt names 
    Rossini  7    otherfiles/a.txt names 
    Oklahoma  8    otherfiles/a.txt places 
    Sydney  6    otherfiles/a.txt places 
    Dallas  6    otherfiles/a.txt places 
    Texas  5    otherfiles/a.txt places 
     San  3    otherfiles/a.txt places 
    Fransisco  9    otherfiles/a.txt places 
     USA  3    otherfiles/a.txt places 
    Cupertino  9    otherfiles/a.txt places 
    Cupertino  9    otherfiles/a.txt places 
     CA  2    otherfiles/a.txt places 
    Vinayak  7    otherfiles/2.txt names 
    Sudhindra  9    otherfiles/3.txt names 
    Sudhindra  9    otherfiles/3.txt names 
    Length = 323 rows 
+0

numpy로 시도하려면 다음을 확인하십시오. http://stackoverflow.com/questions/1987694/print-the-full-numpy-array –

답변

0

순회 아래로하고 각 행을 인쇄하는 것은 파이썬 때로는 긴 출력에 적용되는 절단 주위에 얻을 수있는 가장 쉬운 방법입니다.

을 감안할 때 tastropy.table에서 Table이며,이 시도 :

여기
for row in t: 
    print(row.as_void()) 

rowRow object이며, as_void() 해당 행에 대한 원시 데이터를 생산하고 있습니다.