PyDL:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- pydl v0.7.0 »
- SDSS Utilities (`pydl.pydlutils`) »
- djs_laxisgen

# djs_laxisgen

`pydl.pydlutils.misc.``djs_laxisgen`(dims, iaxis=0)

  Returns an integer array where each element of the array is set equal to its index number along the specified axis.

  Parameters:

  dims : `list`

  > Dimensions of the array to return.

  iaxis : `int`, optional

  > Index along this dimension.

  Returns:

  `numpy.ndarray`

  > An array of indexes with `dtype=int32`.

  Raises:

  :exc:`ValueError`

  > If `iaxis` is greater than or equal to the number of dimensions.

  Notes

  For two or more dimensions, there is no difference between this routine and `djs_laxisnum()`.

  Examples

      >>> from pydl.pydlutils.misc import djs_laxisgen
      >>> print(djs_laxisgen([4,4]))
      [[0 0 0 0]
       [1 1 1 1]
       [2 2 2 2]
       [3 3 3 3]]