In a previous programme I was reading data from a csv file like this:
AllData = np.genfromtxt(open("PSECSkew.csv", "rb"),
delimiter=',',
dtype=[('CalibrationDate', datetime),('Expiry', datetime), ('B0', float), ('B1', float), ('B2', float), ('ATMAdjustment', float)],
converters={0: ConvertToDate, 1: ConvertToDate})
I'm now writing an incredibly similar programme but this time I want to get a really similar data structure to AllData
(except the floats will all be in a csv string this time) but from SQL Server instead of a csv file. What's the best approach?
pyodbc looks like it involves using cursors a lot which I'm not familiar with and would like to avoid. I just want to run the query and get the data in a structure like above (or like a DataTable in C#).