Skip to content

Cross-kind casting in asarray() #264

Closed
@asmeurer

Description

@asmeurer

Should asarray() allow arbitrary casting between dtypes if you call asarray(x, dtype=dtype)? It isn't really clear in the spec if, e.g., asarray(x, dtype=bool) should be required to work if x is an integer or float array, or asarray(x, dtype=float64) if x is integer, and so on. My feeling is that it definitely should work if dtype is a promotable type from x.dtype, but I don't know if casts that aren't required to promote should also be required to work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions