I've been tasked with cleaning a dataset with a "Drive Time" column that lists times taken to drive to a specific location in whole minutes. The values range from 3 to 180 minutes but there is another entry of "Over 3 Hours". The "Over 3 Hours" entries make up just 1.36% of the column so should I delete these, or should I change them to 180 minutes?

Many thanks in advance.

The column, sorted

  • $\begingroup$ This depends heavily on the purpose of your record and should be discussed internally with your principal. $\endgroup$
    – 3r1c
    Feb 5 at 14:27

1 Answer 1


There are many ways to process a data column that is a combination of categorical and numeric variables.

One option is to create two derived features. The first feature would be categorical: "short drive time" or "long drive time". You can decide the threshold based on domain knowledge, "over 3 hours" would definitely be in the "long drive time" category. The second feature would be the numeric: "length of short drive time". Only the raw data that is numeric would be in that feature, "over 3 hours" entries would be dropped.

The goal of feature engineering is to provide as much information to the algorithm so it can learn patterns. It is best practice to avoid dropping or changing values while feature engineering.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.