爲什麼這會返回國家代碼? from pygal.maps.world import COUNTRIES
def get_country_code(country_name):
"""Return the Pygal 2-digit country code for the given country."""
for code, name in COUNTRIES.items
錯誤: TypeError: unsupported operand type(s) for +: 'int' and 'str'
當我的結果產生在我的Python代碼完美花車: data = ",".join(str(x) for x in house_index_data)
0.12,0.29,0.13,0.12,0.23,0.13,0.07,0.21,0.22,0.18,0.11,0
我正在嘗試在pygal中使用api創建條形圖,並根據星星圖表顯示最流行的項目。我在下面發佈了我的代碼,但我無法弄清楚爲什麼我的圖表一直在說「無數據」?有什麼建議麼?謝謝! import requests
import pygal
from pygal.style import LightColorizedStyle as LCS, LightenStyle as LS
url = 'htt