Equivalent of Paste R to Python

后端 未结 8 774
忘掉有多难
忘掉有多难 2021-02-01 14:32

I am a new python afficionado. For R users, there is one function : paste that helps to concatenate two or more variables in a dataframe. It\'s very useful. For example Suppose

8条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-01 15:21

    Let's try things with apply.

    df.apply( lambda x: str( x.loc[ desired_col ] ) + "pasting?" , axis = 1 )
    

    you will recevied things similar like paste

提交回复
热议问题