Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Extreme Trips Durations | Working with Dates and Times in pandas
Dealing with Dates and Times in Python
course content

Conteúdo do Curso

Dealing with Dates and Times in Python

Dealing with Dates and Times in Python

1. Working with Dates
2. Working with Times
3. Timezones and Daylight Savings Time (DST)
4. Working with Dates and Times in pandas

Challenge: Extreme Trips Durations

Now we have the respective columns converted into the correct type. It means now we can manipulate them using the learned methods.

We already have column trip_duration in our dataset, so why do we need to work with datetime objects? Yes, we have, but this number is in seconds, which is not readable at all (since there are 60 seconds in one minute, not 100). Let's see if there are outliers in our dataset.

Tarefa

  1. Create new column duration in df dataframe and save the result of subtracting dropoff_datetime and pickup_datetime columns.
  2. Sort the entire dataframe by newly created column in descending order. Save it in df_sort.
  3. Print the top-5 longest and shortest trips.

Tarefa

  1. Create new column duration in df dataframe and save the result of subtracting dropoff_datetime and pickup_datetime columns.
  2. Sort the entire dataframe by newly created column in descending order. Save it in df_sort.
  3. Print the top-5 longest and shortest trips.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Seção 4. Capítulo 3
toggle bottom row

Challenge: Extreme Trips Durations

Now we have the respective columns converted into the correct type. It means now we can manipulate them using the learned methods.

We already have column trip_duration in our dataset, so why do we need to work with datetime objects? Yes, we have, but this number is in seconds, which is not readable at all (since there are 60 seconds in one minute, not 100). Let's see if there are outliers in our dataset.

Tarefa

  1. Create new column duration in df dataframe and save the result of subtracting dropoff_datetime and pickup_datetime columns.
  2. Sort the entire dataframe by newly created column in descending order. Save it in df_sort.
  3. Print the top-5 longest and shortest trips.

Tarefa

  1. Create new column duration in df dataframe and save the result of subtracting dropoff_datetime and pickup_datetime columns.
  2. Sort the entire dataframe by newly created column in descending order. Save it in df_sort.
  3. Print the top-5 longest and shortest trips.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Seção 4. Capítulo 3
toggle bottom row

Challenge: Extreme Trips Durations

Now we have the respective columns converted into the correct type. It means now we can manipulate them using the learned methods.

We already have column trip_duration in our dataset, so why do we need to work with datetime objects? Yes, we have, but this number is in seconds, which is not readable at all (since there are 60 seconds in one minute, not 100). Let's see if there are outliers in our dataset.

Tarefa

  1. Create new column duration in df dataframe and save the result of subtracting dropoff_datetime and pickup_datetime columns.
  2. Sort the entire dataframe by newly created column in descending order. Save it in df_sort.
  3. Print the top-5 longest and shortest trips.

Tarefa

  1. Create new column duration in df dataframe and save the result of subtracting dropoff_datetime and pickup_datetime columns.
  2. Sort the entire dataframe by newly created column in descending order. Save it in df_sort.
  3. Print the top-5 longest and shortest trips.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Now we have the respective columns converted into the correct type. It means now we can manipulate them using the learned methods.

We already have column trip_duration in our dataset, so why do we need to work with datetime objects? Yes, we have, but this number is in seconds, which is not readable at all (since there are 60 seconds in one minute, not 100). Let's see if there are outliers in our dataset.

Tarefa

  1. Create new column duration in df dataframe and save the result of subtracting dropoff_datetime and pickup_datetime columns.
  2. Sort the entire dataframe by newly created column in descending order. Save it in df_sort.
  3. Print the top-5 longest and shortest trips.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 4. Capítulo 3
Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
We're sorry to hear that something went wrong. What happened?
some-alt