数据帧的“A”列中的数据
'45-54 on Treatment for less than 1 month (Patient) '
'Ocetech| 65-74 Male on Treatment for 10 years or more (Patient) '
'What is this? Don't know screen name | 65-74 Female on Treatment for 6 months to less than 1 year (Patient) '
将列“A”转换为字符串
c2 = c1.to_string(columns = ['A'])
将其转换并存储到c2后,行中的文本不完整,一半的文本不显示。你知道吗
电流输出:
'45-54 on Treatment for less than 1 ...
'Ocetech| 65-74 Male on Treatment f...
'What is this? Don't know scree...
我试图通过使用
c2 = c1['A'].astype('|S80')
但它显示出错误
SystemError: <class 'UnicodeEncodeError'> returned a result with an error set
我建议使用以下方法:
但如果这不起作用,请尝试确保加载时所有字符串都是utf-8。你知道吗
相关问题 更多 >
编程相关推荐