Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
zipcode =[str(x) for x in zipcode] label = list(range(len(zipcode)))
directory = {} for i in label: directory[zipcode[i]] = i data['zipcode']=data['zipcode'].map(directory) [t][1]
在上面的代码之后,我将整个列作为Null值而不是在数字标签中获取所有
Null
我更改的邮政编码的 dtype,但我保留了以前的邮政编码的 sampe dtype,因此我得到了列上的标签