diff --git a/momepy/dimension.py b/momepy/dimension.py index ccc92699..65e2b303 100644 --- a/momepy/dimension.py +++ b/momepy/dimension.py @@ -461,7 +461,7 @@ def __init__( if "median" in mode: medians.append(np.median(values_list)) if "mode" in mode: - modes.append(sp.stats.mode(values_list)[0][0]) + modes.append(sp.stats.mode(values_list, keepdims=False)[0]) else: if "mean" in mode: diff --git a/momepy/diversity.py b/momepy/diversity.py index da4539ae..4cab2fc4 100644 --- a/momepy/diversity.py +++ b/momepy/diversity.py @@ -130,8 +130,8 @@ class Theil: .. math:: - T = \sum_{i=1}^n \left( \\frac{y_i}{\sum_{i=1}^n y_i} \ln \left[ N \\frac{y_i} - {\sum_{i=1}^n y_i}\\right] \\right) + T = \\sum_{i=1}^n \\left( \\frac{y_i}{\\sum_{i=1}^n y_i} \\ln \\left[ N \\frac{y_i} + {\\sum_{i=1}^n y_i}\\right] \\right) Parameters ---------- diff --git a/tests/test_elements.py b/tests/test_elements.py index df51151e..c4a688b6 100644 --- a/tests/test_elements.py +++ b/tests/test_elements.py @@ -117,7 +117,7 @@ def test_Blocks_non_default_index(self): def test_Blocks_inner(self): streets = self.df_streets.copy() - streets.loc[35] = ( + streets.loc[35, "geometry"] = ( self.df_buildings.geometry.iloc[141] .representative_point() .buffer(20)