I read data_frame directly from the database using pandas.io.sql.read_frame :
cnx = pandas.io.sql.connect(host='srv',user='me',password='pw',database='db') df = pandas.io.sql.read_frame('sql_query',cnx)
It works great when retrieving data. But I would like to analyze one of the columns as datetime64 , akin to what you can do when reading from a CSV file, for example:
df2 = pandas.io.read_csv(csv_file, parse_dates=[0])
But for read_frame there is no parse_dates flag. What alternative approach is recommended?
The same question applies to index_col in read_csv, which indicates which col. must be an index. Is there a recommended way to do this with read_frame?
python sql pandas datetime
random.me Mar 05 '13 at 18:44 2013-03-05 18:44
source share