with open('data', 'w') as f:
pickle.dumps({'foo':111},f)
結果 an integer is required (got type _io.TextIOWrapper)
我該如何解決這個問題? 我很肯定An integer is required? open()事先沒有被調用。 Python版本是3.6.2
我想通過將它切成塊並通過處理塊並返回一個numpy數組的函數來處理它。環顧四周後,似乎最好的方法是通過傳遞類作爲參數來使用Pool.map方法。這些類以chunk部分作爲變量啓動,另一個變量用於存儲numpy數組。然後可以分析輸出的類列表以獲取我需要的信息以繼續解決問題。下面是該腳本我想寫的一個簡化版本: from multiprocessing import Pool
class conta