Python Dataframe Apply Custom Function In Arduino