When i try to combine multiple "input factors" into one "final factor" (e.g., inputs = "sales", "roa", and "cfinc"; final = "final" in attached NB), I am left with a NaN if any of the "input factors" were NaNs to begin with. I would like to be able to convert any NaN inside an "input factor" (which i have zscored) to 0s prior to combining into my final factor.
In the attached notebook, you can see the undesirable outcome with ticker 'BNS'. Two of the three "input factors" are giving NaNs, so the final output factor is a NaN as well. Of course I can .dropna() on the pipeline output (final cell in NB), but i would prefer to still have the ticker in my results - with the "final" factor simply a combination of the input factors that are not NaNs.
Any ideas? Thank you and apologies if this is obvious...