2018-11-27'NoneType' object has no attribute 'to_csv' - 简书
www.jianshu.com › p › cf642cd827adNov 26, 2018 · 2018-11-27'NoneType' object has no attribute 'to_csv'. def whvedelnnn(): c = [11,12,21,22,31,32] a = ['tnb','tnb2','OB01','OB02','pjs01','pjs02'] for i in range(6): print(a[i],c[i]) b = eval(a[i]).drop_duplicates(subset=None, keep='first', inplace=True) b.to_csv(str(c[i])+'.csv',index=False) """ ''' (1)指定列,默认所有 (2) (3)true在原数据上修改.'''.
Python Pandas GeopyAttributeError: 'NoneType' object has no ...
stackoverflow.com › questions › 53163909Nov 06, 2018 · To check if an object has an attribute of name longitude you can use: # Returns True/False depending on whether x.longitude is an existing attribute >>> hasattr (x, 'longitude') False. In order to see this behavior in your code you could change the functions get_longitude/get_latitude like so: def get_latitude (x): if hasattr (x,'latitude') and (x.latitude is not None): return x.latitude def get_longitude (x): if hasattr (x,'longitude') and (x.longitude is not None): return x.longitude.