title: jupyter notebook/lab fails on imported function
body: <p>I have a boolean subsetting function that works on a pandas dataframe:</p>
  
  <pre><code>def operational(df):
      return df[(df['cf'] != 0) &amp; (df['ta'] &gt; 0)]
  </code></pre>
  
  <p>it works well in a script and in a jupiter notebook, when entered in cell:</p>
  
  <pre><code>#df = ...
  df2 = operational(df)
  </code></pre>
  
  <p>However, if I keep function definiton in <code>pick.py</code> and import in to jupyter, things go unexpected. It seems upon import of a module jupiter does not reconise the types of variables inside a function:</p>
  
  <pre><code>import pick
  
  pick.operational(df).head()
  
  ---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-16-374442fd7c0a&gt; in &lt;module&gt;()
        1 import pick
  ----&gt; 2 pick.operational(df).head()
  
  C:\Users\Евгений\Documents\GitHub\sandbox\pick.py in operational(_df)
       11 
       12 def operational(df):
  ---&gt; 13     return df[(df['cf'] != 0) &amp; (df['ta'] &gt; 0)]
  
       14 
       15 
  
  TypeError: 'method' object is not subscriptable
  </code></pre>
  
  <p>Is importing something to notebook a generally bad idea? I use jupiter lab, if that matters.</p>