1
I이 CSV 데이터를 쓰고 있지만, 다음과 같은 현재의 출력은 : 는 (맨 윗줄은 헤더 인)파이썬 각 행의 개별 컬럼리스트 작성
A VC_s VC_i VT_s
1 (['Not Reported'],['reported'],['click'])
2 (['Not Reported'],['reported'],['click'])
는 출력을 원하는 다음과 같다 :
는A VC_s VC_i VT_s
1 Not Reported reported click
2 Not Reported reported click
내가 지금까지있어 코드는 다음과 같습니다
ifile = csv.reader(open("input.csv",'rb'))
shutil.copy("input.csv","temp")
tempfile = csv.reader(open("temp","rb"))
ofile = csv.writer(open("RESULTS.csv","ab"))
for row in ifile:
#do some table scraping stuff here
VC_s = str(cells[1].find(text=True))
VC_i = str(cells[2].find(text=True))
VT_s = str(cells[4].find(text=True))
entry = ([VC_s], [VC_i], [VT_s])
rowAdd = tempfile.next()
ofile.writerow(rowAdd + [entry])
,536,
내가 뭘 잘못하고 어떻게 해결할 수 있습니까? 그것은 쉬운 수정처럼 보일 것이다. 그러나 나는 비틀 거리게된다.
entry = [VC_s, VC_i, VT_s]
당신을 감사합니다. 이것은 효과가있다! – serk