Count Number Of Nonzero Elements Python