0

I have some columns that I want to sum in a new column

A B C
1 2 2

EXPECTED OUTPUT

A B C D
1 2 2 5
BigBen
  • 46,229
  • 7
  • 24
  • 40
U.K.Owen
  • 1
  • 2
  • 4
    `df['D'] = df[['A','B','C']].sum(axis=1)`. – Quang Hoang May 02 '23 at 19:11
  • Welcome to stack overflow. Please [edit] your question to include a [mcve] showing _code_ for what you've already tried based on your own research, and what went wrong with your attempts. Please note that this is not a code-writing or tutorial site, and we ask that you at least make an attempt to solve the problem so that we can offer specific advice and answers – G. Anderson May 02 '23 at 19:16

0 Answers0