code: def df(self, keys=None, basis=None, uwi=False):
          
          try:
              import pandas as pd
          except:
              m = "You must install pandas to use dataframes."
              raise WellError(m)
  
          from pandas.api.types import is_object_dtype
  
          if keys is None:
              keys = [k for k, v in self.data.items() if isinstance(v, Curve)]
          else:
              keys = utils.flatten_list(keys)
  
          if basis is None:
              basis = self.survey_basis(keys=keys)
          if basis is None:
              m = "No basis was provided and welly could not retrieve common basis."
              raise WellError(m)
  
          data = {k: v.to_basis(basis) for k, v in self.data.items() if isinstance(v, Curve)}
  
          df = pd.DataFrame(data, columns=list(self.data.keys()))
          df['Depth'] = basis
          df = df.set_index('Depth')
  
          if uwi:
              df['UWI'] = [self.uwi for _ in basis]
              df = df.reset_index()
              df = df.set_index(['UWI', 'Depth'])
  
          for column in df.columns:
              if is_object_dtype(df[column].dtype):
                  try:
                      df[column] = df[column].astype(np.float64)
                  except ValueError:
                      pass
      
          return df
docs: Return current curve data as a ``pandas.DataFrame`` object.
          
          Everything has to have the same basis, because the depth
          is going to become the index of the DataFrame. If you don't
          provide one, ``welly`` will make one using ``survey_basis()``.
  
          Args:
              keys (list): List of strings: the keys of the data items to
                  survey, if not all of them.
              basis (array): A basis, if you want to enforce one, otherwise
                  you'll get the result of ``survey_basis()``.
              uwi (bool): Whether to add a 'UWI' column.
      
          Returns:
              pandas.DataFrame.