Skip to content

np.random.choice raised System.NotSupportedException #488

@alvinfebriando

Description

@alvinfebriando

error on np.random.choice, it said "Specified method isn not supported". Is my usage wrong?

var score = np.arange(1,6);
var p = new[] { 0.2, 0.2, 0.2, 0.2, 0.2 };
var result = np.random.choice(score, probabilities: p);

Stack trace

Unhandled exception. System.NotSupportedException: Specified method is not supported.
   at NumSharp.NPTypeCodeExtensions.GetAccumulatingType(NPTypeCode typeCode)
   at NumSharp.Backends.DefaultEngine.cumsum_elementwise(NDArray& arr, Nullable`1 typeCode)
   at NumSharp.Backends.DefaultEngine.ReduceCumAdd(NDArray& arr, Nullable`1 axis_, Nullable`1 typeCode)
   at NumSharp.np.cumsum(NDArray arr, Nullable`1 axis, Nullable`1 typeCode)
   at NumSharp.NumPyRandom.choice(Int32 a, Shape shape, Boolean replace, Double[] probabilities)
   at NumSharp.NumPyRandom.choice(NDArray arr, Shape shape, Boolean replace, Double[] probabilities)
   at Program.<Main>$(String[] args) 

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