亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

我究竟做錯了什么?TypeError: 不支持的操作數類型 -: 'str' 和 'Cube'

我究竟做錯了什么?TypeError: 不支持的操作數類型 -: 'str' 和 'Cube'

藍山帝景 2023-03-30 10:37:58
我的 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')

該行在應該有“=”的地方有一個“-”。

類型錯誤中的“-”我看的時候并沒有真正為我注冊,但那一行顯然不是你想做的!


查看完整回答
反對 回復 2023-03-30
  • 1 回答
  • 0 關注
  • 133 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號