我用pandas读入了Excel中的数据,有两个问题,第一个是我已经在读入的时候指定了prefecture2一列是string形式,请问为何dtype仍然是object?datas=pd.read_excel('out.xlsx',sep=',',names=['prefecture2', 'Longitude', 'Lagtitude'],iterator=True,dtype = {'prefecture2' : str})
第二个问题是我想将数据中的[府]转换为府,但是运行后却没有任何改变,这是为什么呢?datas['prefecture2']=datas['prefecture2'].str.replace('[府]','府')
图片中是我的数据截图,只有352行,不算大
真诚求教,望不吝赐教,谢谢!