Folium弹出窗口不显示特殊的丹麦字符

2024-09-29 23:24:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个问题,弹出在叶

它没有显示丹麦字符(Æ、Ø和Å),这是哥本哈根地区拼写的一部分

这就是我得到的。。 enter image description here

我在这里偶然发现了类似的问题,但没有一个解决方案对我有效

我的数据集示例:

ence

下面是我的代码示例:

# create map of Copenhagen using latitude and longitude values
map_CPH = folium.Map(location=[ltd, lntd], zoom_start=9)

# add markers to map
for lat, lng, District, PC in zip(df_new2['Latitude'], df_new2['Longitude'], df_new2['District'], df_new2['Postal Code']):
    label = '{}, {}'.format(District, PC)
    label = folium.Popup(label, parse_html=True)
    folium.CircleMarker(
        [lat, lng],
        radius=5,
        popup=label,
        color='blue',
        fill=True,
        fill_color='#3186cc',
        fill_opacity=0.7,
        parse_html=False).add_to(map_CPH)  

map_CPH

Tags: toadd示例mapdfparsefilllabel

热门问题