python 机器学习笔记

Python 中改变和获取当前工作目录

import os

os.chdir("目标目录")   #修改当前工作目录

os.getcwd()    #获取当前工作目录

Debug1:
FileNotFoundError: [WinError 3] 系统找不到指定的路径。: 'trainingDigits'
解决方法:
将下载的源数据中的trainingDigits文件添加到工作空间位置

Debug2:
TypeError: not all arguments converted during string formatting
解决方法:
将print("\nthe total error rate is :%f" % (errorCount/float(mTest)))中的&改为%。



猜你喜欢

转载自www.cnblogs.com/xiaogeboke/p/10453029.html
今日推荐