Using numpy.genfromtxt to read a csv file with strings containing commas
I am trying to read in a csv file with numpy.genfromtxt but some of the fields are strings which contain commas. The strings are in quotes, but numpy is not recognizing the quotes as defining a single string. For example, with the data in 't.csv': 2012, "Louisville KY", 3.5 2011, "Lexington, KY", 4.0 the code np.genfromtxt('t.csv', delimiter=',') produces the error: ValueError: Some errors were detected ! Line #2 (got 4 columns instead of 3) The data structure I am looking for is: array([['2012', 'Louisville KY', '3.5'], ['2011', 'Lexington, KY', '4.0']], dtype='|S13') Looking over the