Python Dataframe Apply Custom Function In Power