Skip to content
Advertisement

difference between count_value(0) vs count_value(1) in pandas [closed]

Request: data[‘Churn’].value_counts(0)

Output:

0 7963 1 2037

Request: data[‘Churn’].value_counts(1)

Output:

0 79.63 1 20.37

Could you please explain how parameters of 1, 0 for value_counts work?

Advertisement

Answer

You can find an answer when reading documentation:

value_counts(0)

is the same as:

value_counts(normalize=0)

which is interpreted as:

value_counts(normalize=False)

While 1 is interpreted as True in the opposite case.

That’s why.

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