擅长:python、mysql、java
<p>好的,我假设您使用Pandas和Matplotlib来处理这些数据。然后,为了得到一个月的平均房屋销售数量,您只需执行以下操作:</p>
<pre><code>import pandas as pd
mean_number_of_homes_sold = data[['neighborhood','homes_sold']].groupby['neighborhood'].agg('mean')
</code></pre>
<p>为了得到只与你想要的社区绘制的信息,你需要这样的东西</p>
<pre><code>import pandas as pd
import matplotlib.pyplot as plt
#fill this list with strings representing the names of the data you need plotted
neighborhoods_to_plot = ['Albany Park', 'Tinley Park']
data_to_graph = data[data.neighborhood.isin(neighborhoods_to_plot)]
fig, ax = plt.subplots()
data_to_graph.plot(kind='scatter', x='avg_sale_to_list', y ='inventory_mom')
ax.set(title='Relationship between time to sale from listing and inventory momentum for selected neighborhoods')
fig.savefig('neighborhood.png', transparent=False, dpi=300, bbox_inches="tight")
</code></pre>
<p>很明显,您可以更改要绘制的数据或图形的类型,但这应该给您一个合适的起点。你知道吗</p>