Skip to content

Commit

Permalink
Merge branch 'gini-polarization' of github.com:sjsrey/inequality into…
Browse files Browse the repository at this point in the history
… gini-polarization
  • Loading branch information
sjsrey committed Dec 29, 2024
2 parents 3658e0b + 1e5f6a7 commit 765ded4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions inequality/theil.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ def __init__(self, y, partition, column=None, partition_col=None):
ng.shape = (ng.size,) # ensure ng is 1-d
# Between group inequality
sg = sg + (sg == 0) # handle case when a partition has 0 for sum
bg = np.multiply(sg,
np.log(np.dot(np.diag(len(y) * 1.0 / ng),
sg))).sum(axis=0)
bg = np.multiply(sg, np.log(np.dot(np.diag(len(y) * 1.0 / ng), sg))).sum(axis=0)

self.T = t
self.bg = bg
Expand Down

0 comments on commit 765ded4

Please sign in to comment.