I have a text file that contains 8 columns, like so
100 40 37 98 47 55 75 67
50 84 93 67 85 90 42 57
68 95 74 75 87 95 32 86
For my function, I need to find averages and such for all the columns, for when specified. So to do this I need to be able to work with columns, and I'm not sure how to convert all the columns into lists.
f=open(file,"r")
lines=f.readlines()
result=[]
for i in lines:
result.append(i.split(' ')[1])
f.close()
I only have this to extract 1 column, but I would appreciate if someone could help me extract every column. My teacher wants us to use pure python, so no add ons like panda or numpy. Thanks