- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload_csv.py
More file actions
Latest commit
24 lines (19 loc) · 539 Bytes
/
Copy pathload_csv.py
File metadata and controls
24 lines (19 loc) · 539 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# python
importcsv
importnumpyasnp
fromsklearn.svmimportSVR
importmatplotlib.pyplotasplt
# Read stock csv file
dates= []
prices= []
defget_data(filename):
withopen(filename, 'r') ascsvfile:
csvFileReader=csv.reader(csvfile)
next(csvFileReader) # skipping column names
forrowincsvFileReader:
dates.append(int(row[0].split('-')[0])) #
prices.append(float(row[1]))
return
get_data('aapl.csv') # calling get_data method by passing the csv file to it
#print "Dates- ", dates
#print "Prices- ", prices