【问题标题】:Adding `column` to geoDataFrame.plot gives TypeError将 `column` 添加到 geoDataFrame.plot 会产生 TypeError
【发布时间】:2017-05-26 20:55:03
【问题描述】:

我有一个 geodataframe 正在尝试绘制。

没有参数,它很高兴地绘制了这个:

但是当我尝试这个gp_aircon_df.geometry.plot(column="coolingHours", cmap='spring'); 我得到:

TypeError: There is no Line2D property "column"

df 真的很简单:

    coolingHours  geometry
0   5377          POLYGON ((130.834539712 -12.45798405399995, 13...
1   5377          POLYGON ((130.8471142530001 -12.37754403699995...
.
.

知道发生了什么吗?

(不是this problem

【问题讨论】:

    标签: python pandas geopandas


    【解决方案1】:

    尝试首先将 .geometry.plot() 的参数定义为字典。例如:

    ch = dict(column="coolingHours", colormap = "spring")
    gp_aircon_df.geometry.plot(**ch)
    

    【讨论】:

      猜你喜欢
      • 2022-08-04
      • 2022-06-28
      • 1970-01-01
      • 2020-02-22
      • 2016-08-01
      • 2018-09-15
      • 2018-09-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多