title: Merging uneven Corresponding Elements from a method returning value in Dictionaries
body: <p>How to sort the data that are stored in a global list after inserting them within a method; so that before they are stacked into another list in accordance to their inserted elements? Or is this a bad practice and complicate things in storing data inside of a global list instead of seperated ones within a method; and finally sorting them thereafter ?</p>
  
  <p>Below is the example of the scenario</p>
  
  <pre><code>list= []
  dictionary = {}
  
  def MethodA(#returns title):
  #searches for corresponding data using beautifulsoup
  #adds data into dictionary
  # list.append(dictionary)
  # returns list
  
  
  def MethodB(#returns description):
  #searches for corresponding data using beautifulsoup
  #adds data into dictionary
  # list.append(dictionary)
  # returns list
  </code></pre>
  
  <p>Example of Wanted output </p>
  
  <pre><code>MethodA():[title] #scraps(text.title) data from the web
  MethodB():[description] #scraps(text.description) from the web
  #print(list)
  &gt;&gt;&gt;list=[{title,description},{title.description},{title,description},{title.description}]
  </code></pre>
  
  <p>Actual output</p>
  
  <pre><code>MethodA():[title] #scraps(text.title) data from the web
  MethodB():[description] #scraps(text.description) from the web
  #print(list)
  &gt;&gt;&gt;list =[{title},{title},{description},{description}]
  </code></pre>
  
  <p>There are a few examples I've seen; such as using Numpy and sorting them in an Array;- </p>
  
  <pre><code>arraylist = np.array(list)
  arraylist[:, 0]
  #but i get a 'too many indices for array'- 
  #because I have too much data loading in; including that some of them 
  #do not have data and are replaced as `None`; so there's an imbalance of indexes.
  </code></pre>
  
  <p>Im trying to keep it as modulated as possible. I've tried using the norm of iteration; </p>
  
  <p>but it's sort of complicated because I have to indent more loops in it;</p>
  
  <p>I've tried Numpy and Enumerate, but I'm not able to understand how to go about with it. But because it's an unbalanced list; meaning that some value are returned as <code>None</code>gives me the return error that; <code>all the input array dimensions except for the concatenation axis must match exactly</code></p>
  
  <p>Example : <code>({'Toy Box','Has a toy inside'},{'Phone', None }, {'Crayons','Used for colouring'})</code> </p>
  
  <blockquote>
    <p>Update; code sample of methodA</p>
  </blockquote>
  
  <pre><code>def MethodA(tableName, rowName, selectedLink):
      try:
          for table_tag in selectedLink.find_all(tableName, {'class': rowName}):
              topic_title = table_tag.find('a', href=True)
              if topic_title:
                  def_dict1 = {
                      'Titles': topic_title.text.replace("\n", "")}
                  global_list.append(def_dict1 )
          return def_dict1 
      except:
          def_dict1 = None
  </code></pre>