I try to convert a list of Chinese province into pinyin use pinyin package, code like below:
df['province'] = df['comb_province'].apply(lambda x: pinyin.get(x, format="strip", delimiter=''))
but I got an error says: 'float' object is not iterable. Why this happens? How can I fix it?
Thank you!