Sto eseguendo lo stesso codice esatto su Windows e Mac, con Python 3.5 64 bit."OverflowError: Python int troppo grande per convertire in C long" su Windows ma non mac
Su Windows, sembra che questo:
>>> import numpy as np
>>> preds = np.zeros((1, 3), dtype=int)
>>> p = [6802256107, 5017549029, 3745804973]
>>> preds[0] = p
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
preds[0] = p
OverflowError: Python int too large to convert to C long
Tuttavia, questo codice funziona bene sul mio mac. Qualcuno potrebbe aiutare a spiegare perché o dare una soluzione per il codice su Windows? Grazie mille!
Sei sicuro che entrambi siano a 64 bit? puoi testare su linux? – Tim
Anche se entrambi i sistemi sono su Python a 64 bit, sono entrambi su NumPy a 64 bit? – user2357112
Un'altra domanda StackOverflow spiega "perché". Su Windows long è a 32 bit e su Unux-like long è a 64 bit. Per favore vedi la domanda http://stackoverflow.com/questions/384502/what-is-the-bit-size-of-long-on-64-bit-windows – VladimirM