i have a pandas dataframe:
Start_time | Duration(minutes)
2018-03-01 16:37:09 | 155
2018-03-01 07:02:10 | 5
2018-03-01 13:07:09 | 250
2018-03-01 20:46:34 | 180
2018-03-01 07:45:49 | 5
I want output as
Start_time | End time 2018-03-01 16:37:09 | 2018-03-01 19:12:09
2018-03-01 07:02:10 | 2018-03-01 07:07:10
2018-03-01 13:07:09 | 2018-03-01 17:17:09
2018-03-01 20:46:34 | 2018-03-01 23:46:34
2018-03-01 07:45:49 | 2018-03-01 07:50:49
I am using following code and getting the output for 5-10 rows as required with an warning and when I applied same code on full data set it is showing error as **TypeError: Cannot compare type 'Timestamp' with type 'int' **
time_temp['End_time'] = pd.DatetimeIndex(time_temp['Start_time']) + pd.to_timedelta(time_temp['Duration'], unit='m')
Error: Cannot compare type 'Timestamp' with type 'int' Warning: /usr/local/lib/python3.5/dist-packages/ipykernel_launcher.py:1: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy """Entry point for launching an IPython kernel.