A diversity index is a method of measuring how many different types there are in a dataset. Diversity indices are statistical representations of different aspects of biodiversity,…