parameters: (obj)
docstring: This function replaces a numpy array to json representation
    of armadillo vector. This is reverse of "arma_to_np(obj)".
docstring_summary: This function replaces a numpy array to json representation
    of armadillo vector. This is reverse of "arma_to_np(obj)".
docstring_tokens: This function replaces a numpy array to json representation of armadillo vector . This is reverse of arma_to_np ( obj ) .
function: def np_to_arma(obj):
    """
    This function replaces a numpy array to json representation
    of armadillo vector. This is reverse of "arma_to_np(obj)".
    """
    if isinstance(obj, OrderedDict):
      for key in obj.keys():
        """
        Checking if this is a numpy array.
        """
        if isinstance(obj[key], np.ndarray):
          # n_rows, n_cols have to be strings.
          n_rows, n_cols = obj[key].shape
  
          dic = OrderedDict()
          
          dic["n_rows"] = str(n_cols) # implicit transpose
          dic["n_cols"] = str(n_rows) # implicit transpose
  
          if n_cols != 1 and n_rows != 1:
            dic["vec_state"] = "0"
          elif n_rows == 1:
            dic["vec_state"] = "1"
          elif n_cols == 1:
            dic["vec_state"] = "2"
  
          elems = obj[key].flatten()
          dic["elem"] = list(elems)
          obj[key] = dic
        else:
          np_to_arma(obj[key])
    elif isinstance(obj, list):
      for i in range(len(obj)):
        np_to_arma(obj[i])
    else:
      # we cannot recurse further if we do not have a
      # dictionary or list object, so just pass.
      pass
function_tokens: def np_to_arma ( obj ) : if isinstance ( obj , OrderedDict ) : for key in obj . keys ( ) : """
        Checking if this is a numpy array.
        """ if isinstance ( obj [ key ] , np . ndarray ) : # n_rows, n_cols have to be strings. n_rows , n_cols = obj [ key ] . shape dic = OrderedDict ( ) dic [ "n_rows" ] = str ( n_cols ) # implicit transpose dic [ "n_cols" ] = str ( n_rows ) # implicit transpose if n_cols != 1 and n_rows != 1 : dic [ "vec_state" ] = "0" elif n_rows == 1 : dic [ "vec_state" ] = "1" elif n_cols == 1 : dic [ "vec_state" ] = "2" elems = obj [ key ] . flatten ( ) dic [ "elem" ] = list ( elems ) obj [ key ] = dic else : np_to_arma ( obj [ key ] ) elif isinstance ( obj , list ) : for i in range ( len ( obj ) ) : np_to_arma ( obj [ i ] ) else : # we cannot recurse further if we do not have a # dictionary or list object, so just pass. pass