original_docstring: 2d list in, but where sub lists may have differing lengths, one big padded 2d arr out
docstring: 2d list in, but where sub lists may have differing lengths, one big padded 2d arr out
docstring_tokens: 2d list in but where sub lists may have differing lengths one big padded 2d arr out
code: def lists_to_2d_arr(list_in, max_len=None):
      '''2d list in, but where sub lists may have differing lengths, one big padded 2d arr out'''
      max_len = max([len(elt) for elt in list_in]) if max_len is None else max_len
      new_arr = np.zeros((len(list_in), max_len))
      for i,elt in enumerate(list_in):
          if len(elt) < max_len:
              new_arr[i,:len(elt)] = elt
          else:
              new_arr[i,:] = elt[:max_len]
      return new_arr
code_tokens: def lists_to_2d_arr ( list_in , max_len = None ) : max_len = max ( [ len ( elt ) for elt in list_in ] ) if max_len is None else max_len new_arr = np . zeros ( ( len ( list_in ) , max_len ) ) for i , elt in enumerate ( list_in ) : if len ( elt ) < max_len : new_arr [ i , : len ( elt ) ] = elt else : new_arr [ i , : ] = elt [ : max_len ] return new_arr
short_docstring: 2d list in, but where sub lists may have differing lengths, one big padded 2d arr out
short_docstring_tokens: 2d list in but where sub lists may have differing lengths one big padded 2d arr out
comment: '''2d list in, but where sub lists may have differing lengths, one big padded 2d arr out'''