根据价格进行分类,为不同价格打上价格标签标签
#对价格进行分类
price_tag = []
for i in range(len(train)):
if train.loc[i+2000,'price'] <= 100:
price_tag.append('0-100')
elif train.loc[i+2000,'price']<=200:
price_tag.append("100-200")
elif train.loc[i+2000,'price']<=300:
price_tag.append('200-300')
elif train.loc[i+2000,'price']<=400:
price_tag.append('300-400')
else:
price_tag.append('>400')
train['Price_tag'] = price_tag
import folium
# define the sydney map
sydney_map = folium.Map(location=[-33.8688, 151.2093], zoom_start=12,tiles='Stamen Toner')
#针对不同价格,用不同颜色表示
for i in range(len(train)):
if train.loc[i+2000,'Price_tag'] == '0-100':
folium.Marker(
location=[train.loc[</

本文介绍了如何利用Python的Folium库对悉尼Airbnb房价进行地图可视化,通过对价格分类并添加价格标签,清晰展示不同区域的房价分布情况。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



