original_docstring: 
      Turns the pandas dataframe into a data matrix.
      Args:
          df (dataframe): aggregated dataframe 
          smooth_value (float): value to add to the matrix to account for the priors
          rows_variable (str): name of dataframe column to use as the rows in the matrix
          cols_variable (str): name of dataframe column to use as the columns in the matrix
          values_variable(str): name of the dataframe column to use as the values in the matrix
      Returns:
          dataframe: pandas matrix that has been normalized on the rows.
      
docstring: Turns the pandas dataframe into a data matrix.
docstring_tokens: Turns the pandas dataframe into a data matrix .
code: def pivot_and_smooth(df, smooth_value, rows_variable, cols_variable, values_variable):
      """
      Turns the pandas dataframe into a data matrix.
      Args:
          df (dataframe): aggregated dataframe 
          smooth_value (float): value to add to the matrix to account for the priors
          rows_variable (str): name of dataframe column to use as the rows in the matrix
          cols_variable (str): name of dataframe column to use as the columns in the matrix
          values_variable(str): name of the dataframe column to use as the values in the matrix
      Returns:
          dataframe: pandas matrix that has been normalized on the rows.
      """
      matrix = df.pivot(index=rows_variable, columns=cols_variable, values=values_variable).fillna(value=0)
      matrix = matrix.values + smooth_value
      
      normed = sklearn.preprocessing.normalize(matrix, norm='l1', axis=1)
      
      return pd.DataFrame(normed)
code_tokens: def pivot_and_smooth ( df , smooth_value , rows_variable , cols_variable , values_variable ) : matrix = df . pivot ( index = rows_variable , columns = cols_variable , values = values_variable ) . fillna ( value = 0 ) matrix = matrix . values + smooth_value normed = sklearn . preprocessing . normalize ( matrix , norm = 'l1' , axis = 1 ) return pd . DataFrame ( normed )
short_docstring: Turns the pandas dataframe into a data matrix.
short_docstring_tokens: Turns the pandas dataframe into a data matrix .
comment: """
      Turns the pandas dataframe into a data matrix.
      Args:
          df (dataframe): aggregated dataframe 
          smooth_value (float): value to add to the matrix to account for the priors
          rows_variable (str): name of dataframe column to use as the rows in the matrix
          cols_variable (str): name of dataframe column to use as the columns in the matrix
          values_variable(str): name of the dataframe column to use as the values in the matrix
      Returns:
          dataframe: pandas matrix that has been normalized on the rows.
      """