I am learning about working with csv's in Python and I would like to read the 3rd column of a csv and print out the contents. I am using the code below but getting an output of 0 when I run it.
with open('prospects.csv', 'r') as csv_file:
pros = csv.reader(csv_file)
for row in pros:
print(row[2])
Below is a snippet of the CSV file:
rank,team,age,teamId,full_name,playerId,atBats,runs,hits,doubles,triples,homeRuns,obp,ops,slg,rbi,baseOnBalls,strikeOuts,stolenBases,caughtStealing,leftOnBase,totalBases,avg,position,sportAbbrev
1,tb,19,,Wander Franco,677551,425,82,139,27,7,9,.398,.885,.487,53,56,35,18,14,177,207,.327,SS,ALL (2)
2,la,22,,Gavin Lux,666158,533,111,177,29,9,28,.405,.983,.578,85,68,126,12,6,178,308,.332,SS,ALL (3)
3,cws,22,,Luis Robert,673357,503,108,165,31,11,32,.376,1.001,.624,92,28,129,36,11,186,314,.328,CF,ALL (3)
4,bal,22,,Adley Rutschman,668939,130,19,33,8,1,4,.351,.774,.423,26,20,27,1,0,56,55,.254,C,ALL (3)
6,ana,21,,Jo Adell,666176,350,63,100,31,0,11,.356,.825,.469,38,34,106,8,0,151,164,.286,OF,ALL (4)