擅长:python、mysql、java
<p>可以按经度和纬度分组,然后在<code>Crime type</code>列上使用<a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.value_counts.html" rel="nofollow noreferrer">^{<cd1>}</a>。</p>
<pre><code>df.groupby(['Longitude', 'Latitude'])['Crime type'].value_counts().to_frame('count')
count
Longitude Latitude Crime type
-0.113767 51.517372 Theft from the person 1
-0.111497 51.518226 Burglary 2
Other theft 1
-0.106453 51.518207 Bicycle theft 1
</code></pre>