我想打开一个自己生成的测深数据
我成功运行了metpy代码
df = pd.read_fwf(get_test_data('nov11_sounding.txt', as_file_obj=False), skiprows=5, usecols=[0, 1, 2, 3, 6, 7], names=col_names)
df['u_wind'], df['v_wind'] = mpcalc.wind_components(df['speed'], np.deg2rad(df['direction']))
现在我想打开我的文件
F = open("ElAlto03012019.dat","r")
F['u_wind'], F['v_wind'] = mpcalc.wind_components(F['speed'], np.deg2rad(F['direction']))
我希望程序接受该文件,但是我得到的是:
回溯(最近一次通话最后):
文件“”,第 1 行,在
类型错误:“文件”对象没有属性“ getitem ”