python - Pandas Series.dt.total_seconds() not found - Stack ...
stackoverflow.com › questions › 45884288Aug 25, 2017 · Alternatively, if you really want to have seconds (since 1970 epoch), you can try this. import pandas as pd from datetime import datetime import time df = pd.DataFrame({'datetime' : [datetime(2012, 11, 19, 12, 40, 10), datetime(2012, 11, 19, 12, 35, 10), datetime(2012, 11, 19, 12, 30, 10), datetime(2012, 11, 19, 12, 25, 10) ]}) df['seconds'] = [time.mktime(t.timetuple()) for t in df.datetime ...