请解决此错误>> float'对象不可迭代

时间:2019-04-14 06:48:59

标签: python-3.x pandas

我正在从数据中删除非ASCII

我的数据集是

department applied english st johns university 499 tamkin road section tamsui 251 taiwan roctab
department english national taiwan normal university 162 heping east road section taipei 106 taiwan roctab
department english national taiwan normal university 162 heping east road section taipei 106 taiwan roctab
beijing laboratory food quality safety china agricultural university beijing 100083 chinaacademy state administration grain beijing 100037 china
beijing technology business university school food science chemical engineering beijing 100048 china
academy state administration grain beijing 100037 china
key laboratory functional dairy college food science nutritional engineering china agricultural university beijing 100083 china
department psychiatry new york university new york new york usa
new york university medical center department biology new york university new york new york usa
new york university medical center department biology new york university new york new york usa

我的代码是

def remove_non_ascii(text):   
    return ''.join(i for i in text if ord(i)<128)

df['Auther_org']= df['Auther_org'].apply(remove_non_ascii)

错误

TypeError: 'float' object is not iterable

0 个答案:

没有答案