pysal / segregation

Segregation Measurement, Inferential Statistics, and Decomposition Analysis
https://pysal.org/segregation/
BSD 3-Clause "New" or "Revised" License
111 stars 26 forks source link

multigroup indices throw error when input has zero population #179

Closed knaaptime closed 3 years ago

knaaptime commented 3 years ago

most multigroup indices can throw the error ValueError: Input contains NaN, infinity or a value too large for dtype('float64' (coming from sklearn manhattan_distances) when the input data do not have NaNs. This happens because this line generates NaNs from a division by zero error if the input data has zero population (i.e. if you have the polygon in a gdf but it contains no people). The fix is the same as #178 and resolved by #174