How can I turn a CSV with such data using csv
['20150101','2','1']
['20150102','10','3']
['20150103','4','2']
['20150104','5','4']
['20150105','12','6']
....
to be iterable with basic for
, len()
, and range()
functions while in its original format (or close to its original format) without turning into a list?
What I have tried:
I tried len()
on the CSV file and I got 2 different errors:
TypeError: object of type '_io.TextIOWrapper' has no len() # without using csv module
TypeError: object of type '_csv.reader' has no len() # using csv module
Even if I use basic function like:
for i, n in enumerate(r):
print(r[n])
I would get such error:
TypeError: '_csv.reader' object is not subscriptable