将数据文件加载到绘图时出现IOError

时间:2017-05-12 09:02:08

标签: python numpy matplotlib genfromtxt

import matplotlib.pyplot as plt

import numpy as np

x,y = np.genfromtxt('D:\Tanjil\Python\directory\Heat Available Datas.csv',unpack=True , delimiter=',',skip_header=0)

plt.plot(x,y,'ro--'),

plt.ylabel('Power Input (kW)'),

plt.xlabel('Speed(rpm)'),

plt.show()

但此代码显示以下错误消息:

File "C:\Users\bad_tanjil\Anaconda\lib\site-packages\numpy\lib\_datasource.py", line 151, in open
    return ds.open(path, mode)

  File "C:\Users\bad_tanjil\Anaconda\lib\site-packages\numpy\lib\_datasource.py", line 501, in open
    raise IOError("%s not found." % path)

IOError: D:\Tanjil\Python\directory\Heat Available Datas.csv not found.

0 个答案:

没有答案