I'm a major newbie when it comes to Python and programming. I've been working with a small data set of Apple Computer stock prices. Successfully have parsed the data into columns and rows, but have been unable to convert the values into integers. Here's my code:
f = open("aapl_2.csv", "r")
data = f.read()
rows = data.split('\r')
aapl_prices = []
for row in rows:
split_row = row.split(",")
aapl_prices.append(split_row)
print(aapl_prices)
print('\n')
full_data = []
for row in rows:
split_row = row.split(",")
split_row[1] = int(split_row[1])
full_data.append(split_row)
Every time I run this I get the follow error: ValueError: invalid literal for int() with base 10: 'Close'.
I've looked everywhere and I'm kind of stumped.
Thanks in advance.