# Change the format of the order date column to datetime format data = data[data['Order Date'].str[0:2] != 'Or'] # this line of code ensures that there is no text in any row or cell data['Order Date'] = pd.to_datetime(data['Order Date'])