Hi,

I have generalized np.atleast_1d, np.atleast_2d, np.atleast_3d with a
function np.atleast_nd in PR#7804
(https://github.com/numpy/numpy/pull/7804).

As a result of this PR, I have a couple of questions about
`np.atleast_3d`. `np.atleast_3d` appears to do something weird with
the dimensions: If the input is 1D, it prepends and appends a size-1
dimension. If the input is 2D, it appends a size-1 dimension. This is
inconsistent with `np.atleast_2d`, which always prepends (as does
`np.atleast_nd`).

  - Is there any reason for this behavior?
  - Can it be cleaned up (e.g., by reimplementing `np.atleast_3d` in
terms of `np.atleast_nd`, which is actually much simpler)? This would
be a slight API change since the output would not be exactly the same.

Thanks,

    -Joe
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to