Closed smsaladi closed 5 years ago
I think this ought to be np.round(np.array(centers)).astype('int')
np.round(np.array(centers)).astype('int')
https://github.com/jjhelmus/nmrglue/blob/a27b0bf796d427144d52d71403276ab0b6225047/nmrglue/analysis/linesh.py#L132
[4] seems to be as intended. [5] does not
[4]
[5]
In [3]: centers = np.linspace(0, 1, 10) In [4]: np.round(np.array(centers)).astype('int') Out[4]: array([0, 0, 0, 0, 0, 1, 1, 1, 1, 1]) In [5]: np.round(np.array(centers).astype('int')) Out[5]: array([0, 0, 0, 0, 0, 0, 0, 0, 0, 1])
Yes the round should be applied prior to the cast to int. Thanks for reporting this and the quick fix.
int
closes via #95
I think this ought to be
np.round(np.array(centers)).astype('int')
https://github.com/jjhelmus/nmrglue/blob/a27b0bf796d427144d52d71403276ab0b6225047/nmrglue/analysis/linesh.py#L132
[4]
seems to be as intended.[5]
does not