Jump to content

Sum one value for each value in a column


Recommended Posts

Hi everyone,

I have a dataframe like this:

 

 

 

Person

Age

 

 

Person1

20

 

 

Person1

20

 

 

Person2

30

 

 

Person2

30

 

 

Person2

30

 

 

 

I'd like to get something like this:

 

 

 

Person

Age

Age2

 

 

Person1

20

20

 

 

Person1

20

 

 

 

Person2

30

30

 

 

Person2

30

 

 

 

Person2

30

 

 

 

 

 

So that I can later be able to add that and get that the total age is 50, instead of 130.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...