Replacing the feature variables with encoded variables
I don't know what is wrong with your code but this worked fine for me-

cat_var.replace(to_replace=cat_var[noms].tolist(),value=encode,inplace=True)

Instead of converting encoded values to series, convert series to list using tolist().