Python Array Count Method In Mysql Query