original_docstring: 
  	vals_init and vals_end are pandas series defined over a common index.
  	linspace_index is a pandas index of the relevant length of the desired linspace.
  	The function returns a pandas series with a gridtype-spaced grid added to each element i in vals_init/vals_end.
  	
docstring: vals_init and vals_end are pandas series defined over a common index.
  linspace_index is a pandas index of the relevant length of the desired linspace.
  The function returns a pandas series with a gridtype-spaced grid added to each element i in vals_init/vals_end.
docstring_tokens: vals_init and vals_end are pandas series defined over a common index . linspace_index is a pandas index of the relevant length of the desired linspace . The function returns a pandas series with a gridtype - spaced grid added to each element i in vals_init / vals_end .
code: def add_grid_to_series(vals_init,vals_end,linspace_index,name,gridtype='linear',phi=1):
  	"""
  	vals_init and vals_end are pandas series defined over a common index.
  	linspace_index is a pandas index of the relevant length of the desired linspace.
  	The function returns a pandas series with a gridtype-spaced grid added to each element i in vals_init/vals_end.
  	"""
  	if gridtype=='linear':
  		apply_grid = lambda x0,xN,N: np.linspace(x0,xN,num=N)
  	elif gridtype=='rust':
  		apply_grid = lambda x0,xN,N: rust_space(x0,xN,N,phi)
  	elif gridtype=='pol':
  		apply_grid = lambda x0,xN,N: pol_space(x0,xN,N,phi)
  	return pd.concat([pd.Series(apply_grid(vals_init.values[i],vals_end.values[i],len(linspace_index)), index = append_index_with_1dindex(vals_init.index[vals_init.index==vals_init.index[i]],linspace_index),name=name) for i in range(len(vals_init))])
code_tokens: def add_grid_to_series ( vals_init , vals_end , linspace_index , name , gridtype = 'linear' , phi = 1 ) : if gridtype == 'linear' : apply_grid = lambda x0 , xN , N : np . linspace ( x0 , xN , num = N ) elif gridtype == 'rust' : apply_grid = lambda x0 , xN , N : rust_space ( x0 , xN , N , phi ) elif gridtype == 'pol' : apply_grid = lambda x0 , xN , N : pol_space ( x0 , xN , N , phi ) return pd . concat ( [ pd . Series ( apply_grid ( vals_init . values [ i ] , vals_end . values [ i ] , len ( linspace_index ) ) , index = append_index_with_1dindex ( vals_init . index [ vals_init . index == vals_init . index [ i ] ] , linspace_index ) , name = name ) for i in range ( len ( vals_init ) ) ] )
short_docstring: vals_init and vals_end are pandas series defined over a common index.
short_docstring_tokens: vals_init and vals_end are pandas series defined over a common index .
comment: """
  	vals_init and vals_end are pandas series defined over a common index.
  	linspace_index is a pandas index of the relevant length of the desired linspace.
  	The function returns a pandas series with a gridtype-spaced grid added to each element i in vals_init/vals_end.
  	"""