Returning multiple values from pandas apply on a DataFrame

后端 未结 1 1317
无人及你
无人及你 2020-12-02 14:33

I\'m using a Pandas DataFrame to do a row-wise t-test as per this example:

import numpy
import pandas

df = pandas.DataFrame(numpy.log2(numpy.ra         


        
相关标签:
1条回答
  • 2020-12-02 14:58

    Returning a Series, rather than tuple, should produce a new multi-column DataFrame. For example,

    return pandas.Series({'pvalue': pvalue, 'mean_ratio': mean_ratio})
    
    0 讨论(0)
提交回复
热议问题