Skip to content

WISH: [option to] make np.floor(), np.ceil(), np.trunc() etc return arrays with dtype=int #4054

@chatcannon

Description

@chatcannon

I'm trying to plot two quantities against each other but they are sampled at different intervals.
I tried plt.plot(array1, array2[np.floor(array1time / array2interval)]).
However, np.floor returns a float array so I need to cast the result to an integer type first.

This seems a bit silly. Is there any reason why someone would depend on the result of floor() being a floating point number?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions