improve _get_ancestors_observation function
improve _get_ancestors_observation function

vivek425ster/pgmpy,liquidmetal/pgmpy,kris-singh/pgmpy,pgmpy/pgmpy,abinashpanda/pgmpy,khalibartan/pgmpy,jhonatanoliveira/pgmpy,sandeepkrjha/pgmpy,sandeepkrjha/pgmpy,yashu-seth/pgmpy,kris-singh/pgmpy,anaviltripathi/pgmpy,palashahuja/pgmpy,liquidmetal/pgmpy,anaviltripathi/pgmpy,pratyakshs/pgmpy,pgmpy/pgmpy,palashahuja/pgmpy,vivek425ster/pgmpy,ankurankan/pgmpy,kislayabhi/pgmpy,kislayabhi/pgmpy,ankurankan/pgmpy,khalibartan/pgmpy,jhonatanoliveira/pgmpy,abinashpanda/pgmpy,yashu-seth/pgmpy,pratyakshs/pgmpy