berniey / hanziconv

Hanzi Converter for Traditional and Simplified Chinese
Other
180 stars 43 forks source link

TypeError: 'float' object is not iterable #23

Closed ahbon123 closed 3 years ago

ahbon123 commented 3 years ago

请问如何将数据框中某一列的繁体字转化为简体字?我用了df['company'].apply(HanziConv.toSimplified),报错如下:

TypeError: 'float' object is not iterable

ahbon123 commented 3 years ago

Problem solved by df['company'].astype(str).apply(HanziConv.toSimplified)