code: def infer(self, rows, headers=1, confidence=0.75):
          
  
          # Get headers
          if isinstance(headers, int):
              headers_row = headers
              while True:
                  headers_row -= 1
                  headers = rows.pop(0)
                  if not headers_row:
                      break
          elif not isinstance(headers, list):
              headers = []
  
          # Get descriptor
          guesser = _TypeGuesser()
          resolver = _TypeResolver()
          descriptor = {'fields': []}
          type_matches = {}
          for header in headers:
              descriptor['fields'].append({'name': header})
          for index, row in enumerate(rows):
              # Normalize rows with invalid dimensions for sanity
              row_length = len(row)
              headers_length = len(headers)
              if row_length > headers_length:
                  row = row[:len(headers)]
              if row_length < headers_length:
                  diff = headers_length - row_length
                  fill = [''] * diff
                  row = row + fill
              # build a column-wise lookup of type matches
              for index, value in enumerate(row):
                  rv = guesser.cast(value)
                  if type_matches.get(index):
                      type_matches[index].extend(rv)
                  else:
                      type_matches[index] = list(rv)
          # choose a type/format for each column based on the matches
          for index, results in type_matches.items():
              rv = resolver.get(results, confidence)
              descriptor['fields'][index].update(**rv)
  
          # Save descriptor
          self.__current_descriptor = descriptor
          self.__build()
  
          return descriptor
docs: https://github.com/frictionlessdata/tableschema-py#schema