Skip to content
Advertisement

count ocurrences and creating a column based on the count in Python

a silly question for most of you.

I have this list:

JavaScript

I need to count how many Ins a jobName has in this list, get this count and populate a new column named Qt_Ins.

it should looks like this:

JavaScript

Could you guys help me again?

Thanks

Advertisement

Answer

Input:

JavaScript

You can use groupby with nunique:

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement