OS X 10.8 端末で、行の長さが約 200 文字の次の Python スクリプトを実行しています。ただし、スクリプトからの出力は約 80 行目で折り返されています。コンソールの長さまで出力行を継続させるにはどうすればよいですか?
ここに私のPythonスクリプトがあります:
import csv as csv
import numpy as np
#Open up the csv file in to a Python object
csv_file_object = csv.reader(open('./data/train.csv', 'rb'))
header = csv_file_object.next() #The next() command just skips the
#first line which is a header
data=[] #Create a variable called 'data'
for row in csv_file_object: #Run through each row in the csv file
data.append(row) #adding each row to the data variable
data = np.array(data) #Then convert from a list to an array
#Be aware that each item is currently a string in this format
for datum in data:
print datum[0:10]
私が得る出力は次のようなものです:
['1' '3' 'Najib, Miss. Adele Kiamie "Jane"' 'female' '15' '0' '0' '2667'
'7.225' '']
['0' '3' 'Gustafsson, Mr. Alfred Ossian' 'male' '20' '0' '0' '7534'
'9.8458' '']