Skip to content

Bug with nanmean #59

@ph-kev

Description

@ph-kev

I am using NaNStatistics v0.6.52 and encountered a bug with nanmean. See the minimal working example below.

using NaNStatistics
using Test

# Expected
small_data = fill(NaN, 2, 3, 4)
nan_mean_small_data = nanmean(small_data, dims = 2)
@test isequal(nan_mean_small_data, fill(NaN, 2, 1, 4)) # pass

# Not expected
large_data = fill(NaN, 180, 10, 360)
nan_mean_large_data = nanmean(large_data, dims = 2)
@test isequal(nan_mean_large_data, fill(NaN, 180, 1, 360)) # fail

The values in nan_mean_large_data are all zeros instead of NaNs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions