title: Name error when calling defined function in Jupyter
body: <p>I am following a tutorial over at <a href="https://blog.patricktriest.com/analyzing-cryptocurrencies-python/" rel="nofollow noreferrer">https://blog.patricktriest.com/analyzing-cryptocurrencies-python/</a> and I've got a bit stuck. I am tyring to define, then immediately call, a function. </p>
  
  <p>My code is as follows:</p>
  
  <pre><code>def merge_dfs_on_column(dataframes, labels, col):
      '''merge a single column of each dataframe on to a new combined dataframe'''
      series_dict={}
      for index in range(len(dataframes)):
          series_dict[labels[index]]=dataframes[index][col]
      return pd.DataFrame(series_dict)
  # Merge the BTC price dataseries into a single dataframe
  btc_usd_datasets= merge_dfs_on_column(list(exchange_data.values()),list(exchange_data.keys()),'Weighted Price')
  </code></pre>
  
  <p>I can clearly see that I have defined the merge_dfs_on_column fucntion and I think the syntax is correct, however, when I call the function on the last line, I get the following error:</p>
  
  <pre><code>NameError                                 Traceback (most recent call last)
  &lt;ipython-input-22-a113142205e3&gt; in &lt;module&gt;()
        1 # Merge the BTC price dataseries into a single dataframe
  ----&gt; 2 btc_usd_datasets= merge_dfs_on_column(list(exchange_data.values()),list(exchange_data.keys()),'Weighted Price')
  
  NameError: name 'merge_dfs_on_column' is not defined
  </code></pre>
  
  <p>I have Googled for answers and carefully checked the syntax, but I can't see why that function isn't recognised when called. </p>