Skip to content
This repository was archived by the owner on Jun 15, 2026. It is now read-only.
This repository was archived by the owner on Jun 15, 2026. It is now read-only.

TypeError: bad operand type for unary -: 'list' #27

@jxrloveyou

Description

@jxrloveyou

Hello, there is an error at '-x' in the following code, is it a problem with the numpy version?

    import numpy as np
def compute_metrics(x):
    sx = np.sort(-x, axis=1)
    d = np.diag(-x)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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