Course Content
Dealing with Dates and Times in Python
Dealing with Dates and Times in Python
Challenge: Is this Common Issue?
In the previous chapter, we found out that issues with negative durations happened because of misusage of 12-h and 24-h formats. We printed the first 10 rows and saw that in all of these rides dropoff_calculated
has the same minute and second (accurate to 1 second), but hours differ by 12.
Let's continue our investigation!
Task
- Filter the observations in
df
dataframe to only with negativeduration
. Save it indf_neg
variable. - Iterate over rows of
df_ned
. If minute indropoff_datetime
anddropoff_calculated
is not the same, you need to print this row. - Within the same
for
loop count number of rows having an hour indropoff_datetime
greater or equal than 12.
Thanks for your feedback!
Challenge: Is this Common Issue?
In the previous chapter, we found out that issues with negative durations happened because of misusage of 12-h and 24-h formats. We printed the first 10 rows and saw that in all of these rides dropoff_calculated
has the same minute and second (accurate to 1 second), but hours differ by 12.
Let's continue our investigation!
Task
- Filter the observations in
df
dataframe to only with negativeduration
. Save it indf_neg
variable. - Iterate over rows of
df_ned
. If minute indropoff_datetime
anddropoff_calculated
is not the same, you need to print this row. - Within the same
for
loop count number of rows having an hour indropoff_datetime
greater or equal than 12.
Thanks for your feedback!
Challenge: Is this Common Issue?
In the previous chapter, we found out that issues with negative durations happened because of misusage of 12-h and 24-h formats. We printed the first 10 rows and saw that in all of these rides dropoff_calculated
has the same minute and second (accurate to 1 second), but hours differ by 12.
Let's continue our investigation!
Task
- Filter the observations in
df
dataframe to only with negativeduration
. Save it indf_neg
variable. - Iterate over rows of
df_ned
. If minute indropoff_datetime
anddropoff_calculated
is not the same, you need to print this row. - Within the same
for
loop count number of rows having an hour indropoff_datetime
greater or equal than 12.
Thanks for your feedback!
In the previous chapter, we found out that issues with negative durations happened because of misusage of 12-h and 24-h formats. We printed the first 10 rows and saw that in all of these rides dropoff_calculated
has the same minute and second (accurate to 1 second), but hours differ by 12.
Let's continue our investigation!
Task
- Filter the observations in
df
dataframe to only with negativeduration
. Save it indf_neg
variable. - Iterate over rows of
df_ned
. If minute indropoff_datetime
anddropoff_calculated
is not the same, you need to print this row. - Within the same
for
loop count number of rows having an hour indropoff_datetime
greater or equal than 12.