How to decide group distance and group number in Mathematics

How to decide group distance and group number in Mathematics

When the number of data is less than 50, it is generally divided into 5 ~ 8 groups; when the number of data is between 50 and 100, it is generally divided into 8 ~ 12 groups. If the frequency of some groups is 0, it should be relaxed