Currently, I am attempting to retrieve numeric data from different CSV files. I then place that data in lists in Python. However, I'm struggling to get Python to determine if there is a value in each separate list of data that is greater than a certain number. I need to be able to search each list separately for some value at which point Python should return some text of my choice. I'm not sure what I'm missing, but Python doesn't seem to be handling my syntax as I was hoping.
import csv
stocks = ['JPM','PG','KO','GOOG']
for stock in stocks:
Data = open("%sMin.csv" % (stock), 'r')
Ticker = []
for row in Data:
Ticker.append(row.strip().split(','))
if Ticker > 735:
print "%s Minimum" % (stock)
I modified the code the other stock became Ticker to remove the confusion.