我的 MSc 論文代碼有一些問題。我正在關注https://github.com/ErikaWarnatzsch/Malawi-Future-Climate-Modelling-Assessment/edit/master/Histogram_TasMAX.py模型,以便能夠在使用歷史記錄的同時為未來的 RCP 場景(4.5 和 8.5)構建直方圖和觀測數據。我正在查看的區域位于哥倫比亞中部地帶。(env) C:\Users\issaa\Desktop\190720>python testewhistogram_tasmax.pyC:\Users\issaa\Anaconda3\envs\env\lib\site-packages\iris\fileformats\cf.py:1038: UserWarning: Ignoring variable 'rotated_pole' referenced by variable 'tasmax': Dimensions ('time', 'string1') do not span ('time', 'rlat', 'rlon') warnings.warn(msg)C:\Users\issaa\Anaconda3\envs\env\lib\site-packages\iris\fileformats\cf.py:1038: UserWarning: Ignoring variable 'rotated_pole' referenced by variable 'tasmax': Dimensions ('time', 'string1') do not span ('time', 'rlat', 'rlon') warnings.warn(msg)C:\Users\issaa\Anaconda3\envs\env\lib\site-packages\iris\fileformats\cf.py:1038: UserWarning: Ignoring variable 'rotated_pole' referenced by variable 'tasmax': Dimensions ('time', 'string1') do not span ('time', 'rlat', 'rlon') warnings.warn(msg)Traceback (most recent call last): File "testewhistogram_tasmax.py", line 161, in <module> main() File "testewhistogram_tasmax.py", line 77, in main CRU - iris.load_cube(CRU, 'near-surface temperature maximum')TypeError: unsupported operand type(s) for -: 'str' and 'Cube'我在 Internet 上看到一些關于它是 Python 2/Python 3 鍵入錯誤的信息——但是我仍然有點困惑從這里去哪里。非常感謝您的幫助:)
1 回答

RISEBY
TA貢獻1856條經驗 獲得超5個贊
我認為這只是一個錯字!
CRU - iris.load_cube(CRU, 'near-surface temperature maximum')
該行在應該有“=”的地方有一個“-”。
類型錯誤中的“-”我看的時候并沒有真正為我注冊,但那一行顯然不是你想做的!
添加回答
舉報
0/150
提交
取消