8000 a.cumsum(dtype=xxx) results bad when len(a) > 10001 (Trac #165) · Issue #763 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
a.cumsum(dtype=xxx) results bad when len(a) > 10001 (Trac #165) #763
Closed
@numpy-gitbot

Description

@numpy-gitbot

Original ticket http://projects.scipy.org/numpy/ticket/165 on 2006-07-03 by trac user cpl, assigned to unknown.

cumsum with any meaningful dtype, on any array larger than 10001 items, has incorrect output. For the 10002-element case, the [1] and [-1] entries are wrong; for a 10003-element array, items (1,2,-2,-1) are bad.
I briefly looked for PyArray_BUFSIZE-related botches, but am confused enough by the code flow to not have gotten very far.

Python 2.4.3 (#1, Apr 3 2006, 18:07:14)
[GCC 4.0.1 (Apple Computer, Inc. build 5247)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import numpy
numpy.version
'0.9.9.2707'
a = numpy.arange(10002)
a.cumsum(dtype='f8')
array([ 0.00000000e+00, 1.00010000e+04, 3.00000000e+00, ...,
4.99950000e+07, 5.00050000e+07, 0.00000000e+00])
a.cumsum(dtype='i2')
array([ 0, 10001, 3, ..., -8968, 1032, 0], dtype=int16)
b = numpy.arange(30000)
a.cumsum(dtype='f8')
array([ 0.00000000e+00, 1.00010000e+04, 3.00000000e+00, ...,
4.99950000e+07, 5.00050000e+07, 0.00000000e+00])

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0