Ordinal Encoding Sklearn.Preprocessing error

Using OrdinalEncoder library, I came across this error:
Input contains NaN, infinity or a value too large for dtype('float64') (Link below)
https://www.codecademy.com/workspaces/626303371876703b64f9fc49

The article says

This method will not work if your feature has NaN values. Those need to be addressed prior to running .fit_transform

https://www.codecademy.com/paths/machine-learning-fundamentals/tracks/mle-fe-data-transformations/modules/fe-data-transformations-for-feature-analysis/articles/fe-encoding-categorical-variables

My question is how to fix this. assuming that the data does not have NaN values.
Thanks,