Skip to content

Reducer n returns int64 dtype while the defautl is float #35

@loreabad6

Description

@loreabad6

Description

As far as I undesrtand, semantique is designed to return all results from reducer operations as float types. However, the n reducer outputs int64 types. This is because n uses numpy.nansum to retrieve the values (see here), which deaults to int types.

Reproducible example

A code chunck that reproduces the bug.

import numpy as np

# Create an array with NaN values
arr = np.array([1, 2, 4, 5])

# Compute the sum of the array elements using numpy.nansum
result = np.nansum(arr)

print(result)
print(type(result))

#> 12
#> <class 'numpy.int64'>

Expected behavior

The result of n is converted to float to keep consistency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions