Getting a runtime waning, division by zero in error function and also plot of error is also not correct

err += y_true[i] * np.log2(hx) + (1-y_true[i])*np.log2(1-hx)

this line is giving division by zero warning

Jupyter Notebook file drive link: