查看: 724|回复: 0
收起左侧

[其他] python中绘制世界地图TypeError: argument of type 'Key' is not iterable。

[复制链接]
ASGDP
发表于 2019-7-5 20:11:12 | 显示全部楼层 |阅读模式
本帖最后由 ASGDP 于 2019-7-5 20:16 编辑

按网上说的,都安装了。运行时一直报错:TypeError: argument of type 'Key' is not iterable。
在网上下载的也是TypeError: argument of type 'Key' is not iterable。
请大神分析下,谢谢!代码一:
  1. import pygal_maps_world.maps

  2. wm = pygal_maps_world.maps.World()
  3. wm.title = 'North, Central, and South America'

  4. wm.add('North Amerca',['ca', 'mx', 'us'])
  5. wm.add('Central America',['bz', 'cr', 'gt', 'hn', 'ni', 'pa', 'sv'])
  6. wm.add('South America',['ar', 'bo', 'br', 'cl', 'co', 'ec', 'gf', 'gy', 'pe',
  7.                         'py', 'sr', 'uy', 've'])

  8. wm.render_to_file('americas.svg')
复制代码

代码二:
  1. import pygal


  2. wm = pygal.maps.world.World()
  3. wm.title = 'Populations of Countries in North America'
  4. wm_key = {'ca':34126000, 'mx':113423000, 'us':309349000}
  5. wm.add('North America',wm_key)


  6. wm.render_to_file('na_populations.svg')
复制代码


您需要登录后才可以回帖 登录 | 快速注册

本版积分规则

手机版|杀毒软件|软件论坛| 卡饭论坛

Copyright © KaFan  KaFan.cn All Rights Reserved.

Powered by Discuz! X3.4( 沪ICP备2020031077号-2 ) GMT+8, 2024-4-24 14:14 , Processed in 0.146131 second(s), 16 queries .

卡饭网所发布的一切软件、样本、工具、文章等仅限用于学习和研究,不得将上述内容用于商业或者其他非法用途,否则产生的一切后果自负,本站信息来自网络,版权争议问题与本站无关,您必须在下载后的24小时之内从您的电脑中彻底删除上述信息,如有问题请通过邮件与我们联系。

快速回复 客服 返回顶部 返回列表