根据价格进行分类,为不同价格打上价格标签标签
#对价格进行分类
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[i