Skip to content

[Feature Request] More powerful power like numpy.power #1392

Closed as not planned
@duskmoon314

Description

@duskmoon314

#1042 has added element-wise power methods powi and powf. But they only accept one parameter.

In NumPy, numpy.power receives two arrays, x1 and x2. The latter could be a number or an array and performs power with different exponents.

An example from: https://numpy.org/doc/stable/reference/generated/numpy.power.html#numpy.power

x1 = np.arange(6)
x2 = [1.0, 2.0, 3.0, 3.0, 2.0, 1.0]
np.power(x1, x2)
# array([  0.,   1.,   8.,  27.,  16.,   5.])

Though we may archive this using an iterator, a more powerful function might fill the gap for users coming from NumPy.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions