---
# System prepended metadata

title: 5/2小組共筆

---

5/2小組共筆
===

吉尼係數計算
---
![](https://i.imgur.com/Nsu3iOq.gif)

![](https://i.imgur.com/A8zIsqB.png)
吉尼係數圖中藍色虛線與實線中的面積除以右下三角形的面積。
```python=
R=np.trapz(x=xx,y=yy)#曲線下面積
A=0.5-R
G=A/(A+R)
print("吉尼係數（Gini Coeffient)")
print(G)


吉尼係數（Gini Coeffient)
0.46011844647436917
```

