code: def last_valid_index(self):
          
  
          def last_valid_index_builder(df):
              df.index = pandas.RangeIndex(len(df.index))
              return df.apply(lambda df: df.last_valid_index())
  
          func = self._build_mapreduce_func(last_valid_index_builder)
          # We get the maximum from each column, then take the max of that to get
          # last_valid_index. The `to_pandas()` here is just for a single value and
          # `squeeze` will convert it to a scalar.
          first_result = self._full_axis_reduce(0, func).max(axis=1).to_pandas().squeeze()
          return self.index[first_result]
docs: Returns index of last non-NaN/NULL value.
  
          Return:
              Scalar of index name.