【发布时间】:2020-02-08 14:03:02
【问题描述】:
import numpy as np
import pandas as pd
import shapefile as shp
import matplotlib.pyplot as plt
import seaborn as sns
shp_path = 'seoul\seoul.shp'
sf = shp.Reader(shp_path)
sf.records()[1]
最后我得到了这个错误 UnicodeDecodeError:“utf-8”编解码器无法解码位置 0 的字节 0xba:无效的起始字节
我想怎么解决这个问题
【问题讨论】:
-
你能添加一个
seoul.shp的例子吗? -
print(sf.fields[1]) ['emd_cd', 'C', 10, 0]
-
有sf.records里面有首尔的记录数据
-
有 sf.shapes() 包含首尔行政区的多边形