Install pontiPy from TestPyPi Server through pip
# !pip install -i https://test.pypi.org/simple/ pontiPy==2.4
Import pontiPy
from pontiPy import *
Dependencies
import pandas as pd
import plotly.express as px
Confusion Matrix (1985-1986)
display(df)
| Forest | Natural | Agriculture | NonVegetated | Water | NotObserved | |
|---|---|---|---|---|---|---|
| Forest | 595909521 | 202111 | 1123311 | 24087 | 254515 | 108 |
| Natural | 338378 | 57102895 | 171374 | 21774 | 180725 | 128 |
| Agriculture | 1090229 | 400869 | 175958382 | 116476 | 38080 | 74 |
| NonVegetated | 10149 | 12805 | 111343 | 2789543 | 7650 | 209 |
| Water | 66613 | 20937 | 11085 | 2131 | 15216393 | 65 |
| NotObserved | 126 | 78 | 86 | 147 | 603 | 22370 |
Create a pontiPy Change Object
matrix_85_86 = pontiPy_Change(df)
Generate Change Matrix
matrix_85_86.matrix()
| Forest | Natural | Agriculture | NonVegetated | Water | NotObserved | Sum | Loss | |
|---|---|---|---|---|---|---|---|---|
| Forest | 595909521 | 202111 | 1123311 | 24087 | 254515 | 108 | 597513653 | 1604132 |
| Natural | 338378 | 57102895 | 171374 | 21774 | 180725 | 128 | 57815274 | 712379 |
| Agriculture | 1090229 | 400869 | 175958382 | 116476 | 38080 | 74 | 177604110 | 1645728 |
| NonVegetated | 10149 | 12805 | 111343 | 2789543 | 7650 | 209 | 2931699 | 142156 |
| Water | 66613 | 20937 | 11085 | 2131 | 15216393 | 65 | 15317224 | 100831 |
| NotObserved | 126 | 78 | 86 | 147 | 603 | 22370 | 23410 | 1040 |
| Sum | 597415016 | 57739695 | 177375581 | 2954158 | 15697966 | 22954 | 851205370 | 4206266 |
| Gain | 1505495 | 636800 | 1417199 | 164615 | 481573 | 584 | 4206266 |
matrix_85_86.quantity()
403201
matrix_85_86.exchange()
3398498
matrix_85_86.shift()
2103816.0
Documentation