Exercice 5: assign grades based on the score

I just wonder why you use a function to apply grades based on score

When should one use function like the one above over the pandas binning feature. I guess the same result could have been achieved with pd.cut or am I wrong ?

Hello, @Orce,

Yes, we can achieve the same with pd.cut. One may want to apply a function when the cuts are based on more than one column.

Another point is that, sometimes, it could just be from the course team’s point of view that the presented approach is better for a broad range of learners given the material already covered. Therefore, you are encouraged to go beyond that :wink: :wink:

Cheers,
Raymond