numpy / numpy/numpy

ENH: Add `out` parameter to all Generator distributions

Open
#15,581 11 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

01 - Enhancement component: numpy.random
Dominant language
Python
Stars
32.8k
Forks
12.8k
Avg merge
1d 7h
Merged PRs (30d)
197

Description

Random distribution functions like numpy.random.binomial allocate a new out array if the input parameters are arrays. This may lead to high memory consumption. Please add the out parameter to such functions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Generator distribution implementations, using numpy.random.binomial as the concrete example named in the issue. Identify the full set of distributions covered by “all Generator distributions” and check how array inputs currently allocate results. Done means the applicable functions accept an out parameter and avoid allocating a new output array when it is provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.