df = pd.read_csv('./Python数据分析/Chapter06/transcount.csv')
运行时提示错误信息:OSError: Initializing from file failed
当我们使用pandas读取文件报这种错误时,一般是因为路径或文件名中带有中文。可以通过下面的方式解决:
path_df = open('./Python数据分析/Chapter06/transcount.csv')
df = pd.read_csv(path_df)
df = pd.read_csv('./Python数据分析/Chapter06/transcount.csv')
运行时提示错误信息:OSError: Initializing from file failed
当我们使用pandas读取文件报这种错误时,一般是因为路径或文件名中带有中文。可以通过下面的方式解决:
path_df = open('./Python数据分析/Chapter06/transcount.csv')
df = pd.read_csv(path_df)