


#強制使用浮點數,

typing可以使用Union
但dispatch不行,
會出現TypeError
Traceback (most recent call last):
File “c:\Python\RF Stable\untitled0.py”, line 7, in <module>
def myFunc(a: Union[float, int], b: Union[float, int]) -> Union[float, int]:
File “C:\ProgramData\Anaconda\lib\site-packages\multipledispatch\core.py”, line 68, in _
dispatcher.add(types, func)
File “C:\ProgramData\Anaconda\lib\site-packages\multipledispatch\dispatcher.py”, line 222, in add
raise TypeError(“Tried to dispatch on non-type: %s\n”
TypeError: Tried to dispatch on non-type: typing.Union[float, int]
In signature: <typing.Union[float, int], typing.Union[float, int]>
In function: myFunc







![Python如何讀寫csv逗點分隔檔(每列內容為新光增有利現金流)?pandas.read_csv(r”路徑\檔名.副檔名”),如何移除list中的nan元素?math.isnan(),如何計算新光增有利IRR?numpy_financial(array) ;輸出csv檔時如何去掉index跟header?如何選擇要寫入的直欄columns? dfFinal.to_csv(fpath, index=False, header=None, columns=[0,1]) Python如何讀寫csv逗點分隔檔(每列內容為新光增有利現金流)?pandas.read_csv(r”路徑\檔名.副檔名”),如何移除list中的nan元素?math.isnan(),如何計算新光增有利IRR?numpy_financial(array) ;輸出csv檔時如何去掉index跟header?如何選擇要寫入的直欄columns? dfFinal.to_csv(fpath, index=False, header=None, columns=[0,1])](https://i1.wp.com/savingking.com.tw/wp-content/uploads/2022/11/20221110122900_3.png?quality=90&zoom=2&ssl=1&resize=350%2C233)



近期留言