我正在编写一个代码,需要我导入一组数据。在我的python文件夹中,我要保存数据以便程序能够识别它?在python中导入数据集
这里是我的代码SNIPPIT:
from matplotlib.pylab import *
from scipy import optimize
# Read in the data, storing it as two 1D arrays, time and speed
freefall=loadtxt('freefall.data')
time = freefall[:,0]
speed = freefall[:,1]
,我试图导入数据文件是freefall.data。
您是否尝试过从''freefall.data''所在的目录运行脚本? – mdml
你不应该把你的Python程序或他们需要的数据放到你的Python文件夹中。把它们放在用户主文件夹的某个地方。 – abarnert