ANN P1 in python