title: Issues with dates and time in Python
body: <p>I need to add 12 hours to dropoff_datetime column for all the trips with negative duration.</p>
  <p>This is the prompt I was given:
  Use where function with three arguments: within the condition compare values of df['duration'] with timedelta(0) object. inplace should be set to True, and other argument need to be set to result of addition dropoff_datetime column and timedelta object with 12 hours.</p>
  <p>Below is the code I have written, but the output still seems to come back incorrect. I think my &quot;other&quot; statement is the issue.</p>
  <pre><code># Load libraries
  import pandas as pd
  from datetime import timedelta
  
  # Loading dataset, creating duration column, and filtering to negative durations
  url = 'https://drive.google.com/uc?id=1YV5bKobzYxVAWyB7VlxNH6dmfP4tHBui'
  df = pd.read_csv(url, parse_dates = ['pickup_datetime', 'dropoff_datetime', 'dropoff_calculated'])
  df[&quot;duration&quot;] = pd.to_timedelta(df[&quot;duration&quot;])
  
  # Task 1: add 12 hours to dropoff duration for negative durations
  df['duration'].where(~(df['duration'] &lt; timedelta(0)), other = df['dropoff_datetime'] + timedelta(12), inplace = True)
  
  # Task 2: recalculate duration column
  df['duration'] = df['dropoff_datetime'] - df['pickup_datetime']
  
  # Task 3: inspect first 10 rows with negative duration
  print(df[df['duration'] &lt; timedelta(0)][[&quot;pickup_datetime&quot;, &quot;dropoff_datetime&quot;, &quot;trip_duration&quot;, &quot;dropoff_calculated&quot;]].head(5))
  </code></pre>
  <p>Output:</p>
  <pre><code>    pickup_datetime        dropoff_datetime       trip_duration  \
  </code></pre>
  <p>34   2016-09-19 11:47:23   2016-09-19 02:21:19   0 days 02:33:56<br />
  66   2016-09-20 12:11:43   2016-09-20 02:15:55   0 days 02:04:13<br />
  74   2016-09-20 12:55:00   2016-09-20 01:03:36   0 days 00:08:36<br />
  132  2017-04-22 12:38:41   2017-04-22 01:20:13   0 days 00:41:32<br />
  231  2017-04-24 12:56:31   2017-04-24 01:06:18   0 days 00:09:47</p>
  <pre><code>    dropoff_calculated  
  </code></pre>
  <p>34   2016-09-19 14:21:19<br />
  66   2016-09-20 14:15:56<br />
  74   2016-09-20 13:03:36<br />
  132  2017-04-22 13:20:13<br />
  231  2017-04-24 13:06:18</p>