Python experts,
Is there a way to get NaN if a name doesn't not exist in the index? Say I pass in a list to retrieve the data Series. Currently, if I do df[myindex]
directly, for those names non-existent in the index, I will get errors like:
KeyError: "['SAL_YIELD_NTM'] not in index"
I'd like to get the normal results back but put Nan for those non-existent index names. Is there a way for this in Python?
Thanks much!