import datetime import pandas as pd from dateutil import tz def dateParse(s1,s2,s3,s4): s=s1+s2+s3+s4 unaware =datetime.datetime.strptime(s, '%Y%m%d%H:%M') aware = unaware.replace(tzinfo=tz.tzutc()) return aware filename = '/data/nsoontie/MEOPAR/analysis/Nancy/tides/PA_observations/ptatkin_rt.dat' obs = pd.read_csv(filename, delimiter=' ',parse_dates=[[0,1,2,3]],header=None,date_parser=dateParse) obs=obs.rename(columns={'0_1_2_3':'time',4:'wlev'}) print obs import matplotlib.pylab as plt %matplotlib inline plt.plot(obs.time,obs.wlev)