How do i work out this date time issue in python
<p>I am new to Python and machine learning and i am trying to work out how to fix this issue with date time. next_unix is 13148730, because that is how many seconds are in five months, which is the time in between my dates. I have searched and i can't seem to find anything that works.</p>

<pre><code>last_date = df.iloc[1,0]
last_unix = pd.to_datetime('2015-01-31 00:00:00') +pd.Timedelta(13148730)
five_months = 13148730
next_unix = last_unix + five_months  


for i in forecast_set:
     next_date = Timestamp('2015-06-30 00:00:00')
     next_unix += 13148730
     df.loc[next_date] = [np.nan for _ in range(len(df.columns)-1)]+[i]
</code></pre>

<p>Error:
  Traceback (most recent call last):</p>

<p>File "", line 1, in 
    runfile('C:/Users/HP/Documents/machine learning.py', wdir='C:/Users/HP/Documents')</p>

<p>File "C:\Users\HP\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 714, in runfile
    execfile(filename, namespace)</p>

<p>File "C:\Users\HP\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 89, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)</p>

<p>File "C:/Users/HP/Documents/machine learning.py", line 74, in 
    next_unix = last_unix + five_months</p>

<p>File "pandas\tslib.pyx", line 1025, in pandas.tslib._Timestamp.<strong>add</strong> (pandas\tslib.c:20118)</p>

<p>ValueError: Cannot add integral value to Timestamp without offset.</p>

<p>If <code>pd.to_datetime</code> returns a python <code>datetime</code> object, then you should look at using a <code>timedelta</code> object for your 5 month interval:</p>

<p><a href="https://docs.python.org/2/library/datetime.html#timedelta-objects" rel="nofollow">https://docs.python.org/2/library/datetime.html#timedelta-objects</a></p>

python pandas