[issue41589] Strange behavior with sparse.dok_matrix decimal is cast to integer

2020-08-19 Thread Eric V. Smith
Eric V. Smith added the comment: This seems like a scipy or numpy issue, not a Python bug. You might have better luck asking about this behavior on a scipy or numpy forum of some kind, or maybe on Stackoverflow. -- nosy: +eric.smith ___ Python tra

[issue41589] Strange behavior with sparse.dok_matrix decimal is cast to integer

2020-08-19 Thread browser.365
New submission from browser.365 : import numpy as np from scipy import sparse import decimal D = decimal.Decimal Al = sparse.dok_matrix((10, 10), dtype=np.dtype(D)) Al.astype(D) Al[1,1] = D('0.1') print(Al[1,1]) print(type(Al[1,1])) Al[0,0] = D('0') print(Al[0,0]) print(type(Al[0,0])) z =