On 2015-03-02, Fabien <fabien.mauss...@gmail.com> wrote: > On 02.03.2015 12:55, greymausg wrote: >> I have a csv file, the first item on a line is the date in the format >> 2015-03-02 I try to get that as a date by date(row[0]), but it barfs, >> replying "Expecting an integer". (I am really trying to get the offset >> in weeks from that date to today()) > > Have you tried Pandas? http://pandas.pydata.org/ > > If your csv file has no other problems, the following should do the trick: > > import pandas as pd > df = pd.read_csv('file.csv', index_col=0, parse_dates= {"time" : [0]})
Ta. Will try > > Cheers, > > Fabien > > > > -- greymaus . . ... -- https://mail.python.org/mailman/listinfo/python-list