class_docstr: NdLayout is a UniformNdMapping providing an n-dimensional
  data structure to display the contained Elements and containers
  in a layout. Using the cols method the NdLayout can be rearranged
  with the desired number of columns.
class_docstr_tok: ["NdLayout","is","a","UniformNdMapping","providing","an","n-dimensional","data","structure","to","display","the","contained","Elements","and","containers","in","a","layout",".","Using","the","cols","method","the","NdLayout","can","be","rearranged","with","the","desired","number","of","columns","."]
docstr: Tuple indicating the number of rows and columns in the NdLayout.
code: def shape(self):
      "Tuple indicating the number of rows and columns in the NdLayout."
      num = len(self.keys())
      if num <= self._max_cols:
          return (1, num)
      nrows = num // self._max_cols
      last_row_cols = num % self._max_cols
      return nrows + (1 if last_row_cols else 0), min(
          num, self._max_cols
      )
  
imports: import numpy
  import param
  from .None import traversal
  from .dimension import Dimension, Dimensioned, ViewableElement, ViewableTree
  from .ndmapping import NdMapping, UniformNdMapping
label_desc: Use image node_id 3 for calling the NdLayout obj's underlying member method code with example usage: obj.shape() and returns: unknown,  min, int,  num