2017-04-22 4 views
0

Ich möchte alle Zeilen in der Tabelle drucken. "stat_data" Liste hat 323 Elemente, die ich auf der Konsole drucken möchte.Alle Zeilen in der Tabelle drucken

Verwendet den folgenden Code, um dies zu tun.

Aber es druckt nur weniger Zeilen, nicht alle von ihnen. Hilf mir, alle Zeilen zu drucken.

Ausgabe des obigen Code ist wie unten

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

Wenn Sie mit numpy versuchen möchten, dann überprüfen Sie dies - http://StackOverflow.com/Questions/1987694/Print-the-Full-Numpy-Array –

Antwort

0

Iterieren über eine Tabelle und jede Zeile Druck ist eine einfache Möglichkeit, um das Abschneiden zu erhalten, die manchmal zu lange Python Ausgänge gilt.

Da t ein Table von astropy.table ist, versuchen Sie dies:

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

Hier row ist ein Row object und as_void() erzeugt die Rohdaten für diese Zeile.

Verwandte Themen