pyspark.pandas.Index.shape

property Index.shape

Return a tuple of the shape of the underlying data.

Examples

>>> idx = ps.Index(['a', 'b', 'c'])
>>> idx
Index(['a', 'b', 'c'], dtype='object')
>>> idx.shape
(3,)
>>> midx = ps.MultiIndex.from_tuples([('a', 'x'), ('b', 'y'), ('c', 'z')])
>>> midx  
MultiIndex([('a', 'x'),
            ('b', 'y'),
            ('c', 'z')],
           )
>>> midx.shape
(3,)