I have a CSV file, here is a sample of what it looks like:
Year: Dec: Jan: 1 50 60 2 25 50 3 30 30 4 40 20 5 10 10
Reading it columnwise is harder?
Anyway this reads the line and stores the values in a list:
for line in open("csvfile.csv"): csv_row = line.split() #returns a list ["1","50","60"]
Modern solution:
# pip install pandas import pandas as pd df = pd.read_table("csvfile.csv", sep=" ")