python OSError: Initializing from file failed

关注微信公共号:小程在线

关注CSDN博客:程志伟的博客

 

from numpy import *
import pandas as pd
###线性回归####
#读取数据
data = pd.read_csv('D://公共号文章//Advertising.csv', index_col=0)

提示报错:

OSError: Initializing from file failed

改成如下:

f = open('D://公共号文章//Advertising.csv')
data = pd.read_csv(f)

前几行数据如下:

python OSError: Initializing from file failed_第1张图片

你可能感兴趣的:(python)