You answered your question. Just go through
missing = 'drop'
to ols
import statsmodels.formula.api as smf ... results = smf.ols(formula = "da ~ cfo + rm_proxy + cpi + year", data=df, missing='drop').fit()
If this does not work, then this is a mistake and report it using MWE on github.
FYI, pay attention to the import above. Not everything is available in the formula.api namespace, so you should keep it separate from statsmodels.api. Or just use
import statsmodels.api as sm sm.formula.ols(...)
source share