pwrs.core.set_reorder#

pwrs.core.set_reorder.set_reorder(A, B, idx, dim)[source]#

Insert reordered slices along a specified dimension.

Mirrors MATPOWER’s set_reorder helper by writing B into A at the one-based indices idx along the requested dimension, expanding the target array shape when necessary.

Parameters:
  • A (array_like) – Destination array-like value.

  • B (array_like) – Source values to insert.

  • idx (array_like) – One-based destination indices.

  • dim (int) – One-based dimension along which to assign.

  • nargout (int, optional) – MATLAB compatibility flag.

Returns:

Updated array with B inserted into A.

Return type:

numpy.ndarray