在 Python 3.x 中是否有 array_count_values() 类似物或最快的方法
从
d = ["1", "this", "1", "is", "Sparta", "Sparta"]
Run Code Online (Sandbox Code Playgroud)
到
{
'1': 2,
'this': 1,
'is': 1,
'Sparta': 2
}
Run Code Online (Sandbox Code Playgroud) python ×1