Thank You KFrank.
That resolved my doubt and was really helpful.
I have one more thing - In this case, I have integer categorical labels but they are starting from 1 not 0, so do I need to convert them to start from 0 to get them mapped to the [0] element.