Returning multiple values from pandas apply on a DataFrame
Returning a Series, rather than tuple, should produce a new multi-column DataFrame. For example, return pandas.Series({‘pvalue’: pvalue, ‘mean_ratio’: mean_ratio})
Returning a Series, rather than tuple, should produce a new multi-column DataFrame. For example, return pandas.Series({‘pvalue’: pvalue, ‘mean_ratio’: mean_ratio})