code: def first(self):
          
          if self.mode == 'local':
              return self.values[0]
  
          if self.mode == 'spark':
              return self.values.first().toarray()
docs: Return the first element.