Code is totally correct don't know why this error happen that hist/gen has incorrect type

Hello @Sukhpreet_singh1 ,

Is your problem solved or are you still stuck?
If stuck then send me your notebook via dm.
Then we will discuss the issues here.

With regards,
Nilosree Sengupta