A robot-camera helper may need to turn a two-row array into a three-row array with a different width. A call named resize can produce exactly the requested dimensions while filling the result by cycling through old values. The shape looks plausible, but no spatial interpolation has taken place.
NumPy's top-level resize function and the ndarray resize method also behave differently when an array grows. An original tagged-grid fixture separates their value provenance, mutation, and return behavior. The point is to inspect what filled the new cells before a downstream vision report treats the array as a larger image.
Use distinctive tags instead of a realistic picture
Start with a synthetic int16 array of shape (2,3). Its first row is [2,5,9] and its second row is [14,20,27]. The numbers are deliberately distinctive tags. They do not represent measured brightness, a camera calibration, or a robot inspection result.
Request shape (3,4), which needs twelve entries instead of the original six. A shape check alone cannot explain where the additional six entries came from. Keeping the tags visible lets a reviewer trace each output cell back to the source without relying on a display's contrast or an apparent visual pattern.
The fixture uses NumPy 2.5.2 and Python 3.14.7. It records the source dtype and shape, both enlarged arrays, a smaller-array case, and an empty-source boundary case. No camera or production image pipeline is connected to the experiment.
Follow the top-level function's sequence
The call np.resize(source,(3,4)) returns rows [2,5,9,14], [20,27,2,5], and [9,14,20,27]. Reading the original in C index order gives the six-value sequence 2,5,9,14,20,27. The function fills twelve output positions by using that sequence twice.
Notice the fourth entry in the first output row. It is 14, which came from the first entry of the second source row. It is not a new sample between 9 and an image boundary, and it is not the result of extending the first source row independently. The output row width simply changes where the repeated sequence is broken into rows.
Every source tag appears twice in this particular enlarged result. That count proves reuse of existing values in this fixture; it does not describe a twofold improvement in image resolution or two observations of the same physical point. A consumer needs an explicit spatial sampling contract before assigning pixel coordinates to the new grid.
A smaller shape is not automatically a spatial crop
Requesting np.resize(source,(2,2)) returns [2,5] in the first row and [9,14] in the second. The operation has used the first four values of the same C-order traversal. A top-left two-by-two selection from the source would instead contain rows [2,5] and [14,20].
The difference is visible at output position [1,0]: the function result has 9, while the stated crop has 14. Both arrays are two by two. Checking dimensions, dtype, or a successful call would not determine which coordinate relationship the helper implemented.
This is a value-provenance check, rather than a recommendation that cropping is always the desired operation. The application should first say whether it needs a coordinate selection, boundary padding, interpolation, or another mapping. A convenient function name cannot supply that missing decision.
The array method uses a different growth rule
Create an independent owning array from the source values inside a local helper, then call working.resize((3,4)) with the default reference check. In that fixture, the method returns None and changes the working array itself. Its rows become [2,5,9,14], [20,27,0,0], and [0,0,0,0].
The six old entries occupy the beginning of this contiguous working array's traversal; the six added entries are zero. This differs from the top-level function, which returned a new enlarged array filled by repeated data. The unchanged source remains two by three in both comparisons because the in-place method was applied only to the independent working copy.
Zeros are still introduced values in this experiment. They are not observations of a dark scene, confirmed absence of an object, or evidence that the camera measured six additional pixels. Replacing repetition with zero fill would change the provenance contract again, rather than establish a correct image resampling procedure.
Keep mutation and allocation separate from image meaning
The separate ndarray.resize reference describes in-place changes and restrictions involving contiguous storage, ownership, and references. A preliminary module-scope attempt was rejected by that check; the recorded local-helper construction succeeded. Neither attempt disabled the check or used a shared camera buffer. This success is not a promise that every view can be enlarged in place.
The top-level result is a separate array in the tested case; the memory-sharing check is false. That distinction matters if another consumer retains the original data. It does not answer whether either enlarged grid represents the coordinates the vision application expects. Allocation behavior and sampling meaning need independent checks.
An empty-source test adds one boundary to the repetition explanation. Resizing an empty int16 source to two by two returns zeros in the executed environment. There are no source tags to cycle through. Do not turn the nonempty example's repeated values into a claim that every enlargement always contains a repeated source sample.
Preserve the operation in the derived-image record
A proposed receipt keeps the exact callable, original identity, original and target shapes, dtype, coordinate meaning, value-fill policy, and mutation expectation. Its small acceptance fixture checks selected output coordinates and raw-source preservation. If the requirement is spatial resampling, the receipt must identify the actual interpolation procedure and mapping being evaluated.
This experiment evaluates no alternative image resampler and claims no visual quality, timing, or robot-detection improvement. It establishes a narrower result: obtaining the requested shape with np.resize can repeat a flattened value sequence, while the similarly named array method can introduce zeros. Neither outcome alone establishes newly sampled image information.
Sources checked November 18, 2026:
NumPy, numpy.resize, version 2.5 manual:
https://numpy.org/doc/stable/reference/generated/numpy.resize.html
NumPy, numpy.ndarray.resize, version 2.5 manual:
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.resize.html
All tagged grids, comparisons, and proposed receipt checks are original T-800 editorial work. The local calculations are synthetic and reproduce no source example or physical camera test.
Illustration: an AI-generated concept traces repeated tags and zero-filled cells from the same invented source grid. It is not a real camera image or an interpolation benchmark.