Decision Tree Learning
Lets assume after some splits you are left with two records with 3 features/attributes (last column being the truth label)
1   1   1   2
2   2   2    1
Now you are about to select the next best feature to split on, so you call this method remainder(examples, attribute) as part of selection which internally calls nk1, pk1 = pk_nk(1, examples, attribute). 
The value returned by pk_nk for the above mentioned rows and features will be 0, 0 which will result in divide by zero exception for e1 = b(pk1/(pk1 + nk1)). This is a valid scenario based on how you coded the DT and you should be handling the case.
I want to implement the decision-tree learning alogorithm.
I am pretty new to coding so I know it's not the best code, but I just want it to work. Unfortunately i get the error: e2 = b(pk2/(pk2 + nk2))
ZeroDivisionError: division by zero
Can someone explain to me what I am doing wrong?