I'm having difficulty importing data from a file .csv. I am just trying to import data and print the maximum value. Here is my code:
>>> x, y = numpy.loadtxt('data.csv', delimiter=',', usecols=(4,5), unpack=True)
>>> print 'max =', max(x)
When you enter the above code, the following error message appears:
TypeError: 'numpy.float64' object is not iterable
I tried changing the data type with an argument dtype=int, but it threw the same error. Does anyone know what could be the problem? Thanks in advance for your help!
source
share