(x, ndim)
| 4543 | # or NUMPY_LICENSE.txt within this directory |
| 4544 | |
| 4545 | def atleast_nd(x, ndim): |
| 4546 | x = asanyarray(x) |
| 4547 | diff = max(ndim - x.ndim, 0) |
| 4548 | if diff == 0: |
| 4549 | return x |
| 4550 | else: |
| 4551 | return x[(None,) * diff + (Ellipsis,)] |
| 4552 | |
| 4553 | def format_index(index): |
| 4554 | return "arrays" + "".join(f"[{i}]" for i in index) |
no test coverage detected
searching dependent graphs…