def __len__(self):
        """Eagerly get the length of the MultiIndex.

        Note that if the length is unknown (such as for WeldObjects),
        it will be eagerly computed.

        Returns
        -------
        int
            Length of the MultiIndex.

        """
        if self._length is not None:
            return self._length
        else:
            # first check again for raw data
            length = infer_length(self.values)
            if length is None:
                # empty DataFrame
                if len(self.values) == 0:
                    return 0

                # use the first column to compute the length
                length = len(self.values[0])

            self._length = length

            return length
def __len__ ( self ) : if self . _length is not None : return self . _length else : length = infer_length ( self . values ) if length is None : if len ( self . values ) == 0 : return 0 length = len ( self . values [ 0 ] ) self . _length = length return length
Eagerly get the length of the MultiIndex.

        Note that if the length is unknown (such as for WeldObjects),
        it will be eagerly computed.

        Returns
        -------
        int
            Length of the MultiIndex.