mport pandas as pd
import numpy as np
import geopandas as gp
import matplotlib.pyplot as plt
import csv
import shapely
import fiona
import scipy
data = pd.read_csv('D:\data\Anhui\AH_adm.csv',encoding='GBK')
AH_geod = gp.GeoDataFrame.from_file('D:\data\Anhui\安徽省地级市shape文件\安徽.shp',encoding = 'GBK')
#data.head(17)
#print(data.head(17))
#AH_geod.head(17)
#print(AH_geod.head(17))
data_geod = gp.GeoDataFrame(data)
AH_geod = AH_geod.rename(index = str,columns = {'NAME2004':'NAME_2'} )
da_merge = AH_geod.merge(data_geod,on='NAME_2',how = 'left')
#da_merge.head(2)
#print(da_merge.head(2))
fig, ax = plt.subplots(1, 1)
da_merge.plot(column='numble2', ax=ax, legend=True,edgecolor='black')
plt.show()