我只想比较旧金山,西雅图和波特兰。下面的代码显示每个区域。 ax2.scatter(x=df['region']...
f, (ax1, ax2) = plt.subplots(1, 2, figsize=(14,8))
ax1.scatter(x=df['AveragePrice'], y=df['Total Volume'])
ax2.scatter(x=df['region'], y=df['AveragePrice'])
plt.tight_layout()
plt.xticks(rotation=90)
plt.show()
答案 0 :(得分:0)
您可以尝试
ax1.scatter(x=df.loc[df['region'].isin(['SanFrancisco', 'Portland', 'Seattle']), 'region'), y=df['AveragePrice'])
您可以找到more examples here