title: Using a function to call another function
body: <p>I am attempting to use the <code>memory_profiler</code> package. Example code below:</p>
  <pre><code>from memory_profiler import memory_usage
  from time import sleep
  
  def f():
      # a function that with growing
      # memory consumption
      a = [0] * 1000
      sleep(.1)
      b = a * 100
      sleep(.1)
      c = b * 100
      return a
  
  mem_usage = memory_usage(f)
  print('Memory usage (in chunks of .1 seconds): %s' % mem_usage)
  print('Maximum memory usage: %s' % max(mem_usage))
  </code></pre>
  <p>The problem I am facing is that my actual function I want to try this on takes arguments.</p>
  <pre><code>def my_func(df1, df2):
      new_df = pd.concat([df1, df2])
      return new_df
  </code></pre>
  <p>Is there a way to create a shell function that runs my real function so that I can use this package?</p>
  <pre><code>def shell_function():
      new_df = my_func(df1, df1)
      return new_df
  </code></pre>
  <p>Code is from 2nd answer on this post: <a href="https://stackoverflow.com/questions/9850995/tracking-maximum-memory-usage-by-a-python-function">Tracking *maximum* memory usage by a Python function</a></p>