Pandas qcut - technique


While going through the titanic problem solution I saw someone use a pandas qcut and cut command.

After some I got to understand that while pandas cut command creates equispaced bins but keeps the frequency of samples in bins variable (unequal)…whereas qcut creates unequal size bins but keeps the frequency of samples same in each bin.

Now in the solution I saw the kernel author use pandas cut command to create slabs / range / catgeories for Age attribute whereas when it came to categorizing Fare he used Pandas qcut command.

What was the necessity to use qcutwhat could be the drivers to use qcutwhat was achieved by using qcut which could not be achieved using cut command.



© Copyright 2013-2019 Analytics Vidhya