title: How to feed a list of lists into *args when the number of inside lists is unknown?
body: <p>I've got a function which takes positional arguments in this format. Editing it isn't feasible for my use case (long story).</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  import random
  
  def dummy_func(*args):
  
      outlist = []
  
      for arg in args:
          arg.append(42)
  
          outlist.append(arg)
  
      return outlist
  </code></pre>
  
  <p>Normally, function accepts any number of lists of integers in the following format and processes them like this:</p>
  
  <pre><code>s1 = [random.randrange(1, 101, 1) for _ in range(10)]
  s2 = [random.randrange(1, 101, 1) for _ in range(10)]
  s3 = [random.randrange(1, 101, 1) for _ in range(10)]
  
  dummy_func(s1,s2,s3)
  </code></pre>
  
  <p>I'm trying to build a function that assembles a list of lists of integers to feed to the <code>dummy_func</code> listed above. The lists are all the same length, but we're feeding them to the function in batches and we don't know how many lists will be in each batch.</p>
  
  <pre><code>def analyse_some_series():
  
      # Generate a random number of lists
      count = np.random.choice(10)
  
      for i in range(count):
  
          mylist = [random.randrange(1, 101, 1) for _ in range(10)]
  
          outer_list.append(mylist)
  
      # This does not work for some reason
      finalfunc(outer_list)
  </code></pre>
  
  <p>For some reason, when you feed the list of lists to the function, it does not unwrap and process the list of lists. Instead it just sees one list object in the wrong format.</p>
  
  <p>Now normally I would just do something like:</p>
  
  <pre><code>x,y,z = series_list
  </code></pre>
  
  <p>But that won't work here since we don't know how many lists are going to be generated.</p>
  
  <p>Any help you could offer would be greatly appreciated.</p>