Error originated in the phjGetBestAlternativePostcodes() function. Basically, a scratch dataframe containing all the misformed postcodes was created and an attempt to calculate the minimum Damerau-Levenschtein distance was calculated using a lambda function. If the scratch dataframe was an empty dataframe (i.e. no incorrect postcodes identified), the ValueError exception was raised. This was addressed by checking that the scratch dataframe was not empty before attempting to calculate min DL distances.
Error originated in the phjGetBestAlternativePostcodes() function. Basically, a scratch dataframe containing all the misformed postcodes was created and an attempt to calculate the minimum Damerau-Levenschtein distance was calculated using a lambda function. If the scratch dataframe was an empty dataframe (i.e. no incorrect postcodes identified), the ValueError exception was raised. This was addressed by checking that the scratch dataframe was not empty before attempting to calculate min DL distances.