jupyter导入数据常见问题
- 报错1
ModuleNotFoundError: No module named 'numpy.testing.nosetester'
- 解决方案
pip install numpy==1.17.0
- 报错2
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
- 解决方案,将单斜杠改为双斜杠
data=pd.read_csv('C:\\Users\\ychen\\Desktop\\案例\\CustomerChurn.csv',encoding='gb2312')
- 报错3
OSError: Initializing from file failed
- 解决方案,路径中不包含中文
data=pd.read_csv('C:\\Users\\ychen\\Desktop\\demo\\CustomerChurn.csv',encoding='gb2312')