Skip to content

ak.std returns nan wrongly when being applied on int array #3525

@mrzimu

Description

@mrzimu

Version of Awkward Array

2.8.3

Description and code to reproduce

Dear developers,

I found that for some reasons, when processing int arrays, ak.std returns nan, even though np.std does return a value. I have checked that there is no nan or inf in the array. Here are the codes to reproduce the problem:

import awkward as ak
import numpy as np

data = np.loadtxt("data.csv", delimiter=",", dtype=np.int64) # A 1D array

print("awkward:", ak.std(data))
print("numpy:", np.std(data))

The output would be

awkward: nan
numpy: 458469074.0604589

Data file is as followed:

data.csv

My understanding is that ak.std should perform as np.std, at least should be the same when being applied on 1D array, so I think this can be a bug.

The platform information is: Python 3.11 on AlmaLinuxOS9.

Hope this report can be helpful.

Best!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug (unverified)The problem described would be a bug, but needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions