Skip to content
Advertisement

Fuzzy matching issue with matching nan values

I have a dataframe called RawDatabase which I am am snapping values to a validation list which is called ValidationLists. I take a specific column from the RawDatabase and compare the elements to the validation list. The entry will be snapped to the entry in the validation list it most closely resembles.

The code looks like this:

JavaScript

In an example the rawDatabase[field] looks like:

JavaScript

and the validationList looks like:

JavaScript

I am trying to snap all the values so that the new rawDatabase[field] looks like:

JavaScript

I however seem to have a problem when I try to snap an NaN value to the validationList (even when I include NaN in the validationList as a test).

What is the best way to handle NaN values (so the NaN value in the snapped dataset is blank)?

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement