How to map a function using multiple columns in pandas?

前端 未结 4 527
南旧
南旧 2021-02-02 11:59

I\'ve checked out map, apply, mapapply, and combine, but can\'t seem to find a simple way of doing the following:

I have a dataframe with 10 columns. I need to pass thre

4条回答
  •  鱼传尺愫
    2021-02-02 12:19

    I'm using the following:

    df['d'] = df.apply(lambda x: some_func(a = x['a'], b = x['b'], c = x['c']))
    

    Seems to be working well, but if anyone else has a better solution, please let me know.

提交回复
热议问题