Count Occurrences Of Elements In Array Python Definition