Diversity Approximate#

agreement_index(election) dict[source]#

Calculates the approx. agreement index of the election.

Parameters:

election (OrdinalElection)

Returns:

‘value’: approx. agreement index

Return type:

dict

diversity_index(election) dict[source]#

Calculates the approx. diversity index of the election.

Parameters:

election (OrdinalElection)

Returns:

‘value’: approx. diversity index

Return type:

dict

polarization_index(election) dict[source]#

Calculates the approx. polarization index of the election.

Parameters:

election (OrdinalElection)

Returns:

‘value’: approx. polarization index

Return type:

dict

remove_diag(mtrx)[source]#

Return: Input frequency_matrix with diagonal removed (shape[1] - 1)

swap_distance_between_potes(pote_1: list, pote_2: list, m: int) int[source]#

Return: Swap distance between two potes