Summary of Chinese bug in python
- python
- bug
1. matplotlib pyplot 绘图显示中文:
1 | import matplotlib.pyplot as plt |
2. juypter 读取中文编码的文件乱码
在读取中文文件时,出现错误UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start byte
在读取函数中添加encoding = "GBK"
,例:
1 | pd.read_csv("your_file_path", encoding = "GBK") |
-------------文章结束啦 ฅ●ω●ฅ 感谢您的阅读-------------