code: def remove_end_NaN(self, data, var=None):
          
          
          # Limit to one or some variables
          if var:
              end_ok_data = data[var].last_valid_index()
          else:
              end_ok_data = data.last_valid_index()
  
          data = data.loc[:end_ok_data, :]
          return data
docs: Remove end NaN.
          
          CHECK: Note issue with multi-column df.
          
          Parameters
          ----------
          data    : pd.DataFrame()
              Input dataframe.
          var     : list(str)
              List that specifies specific columns of dataframe.
  
          Returns
          -------
          pd.DataFrame()
              Dataframe starting from its last valid index.