title: Line Magics - Unresolved references in PyCharm
body: <p>I am relatively new to the world of Python and using McKinney's book to learn data analysis. My IDE is PyCharm Professional 2018.2</p>
  
  <p>McKinney uses <a href="https://ipython.readthedocs.io/en/stable/interactive/magics.html" rel="nofollow noreferrer">Line Magics</a> to compute elapsed time.</p>
  
  <pre><code>import numpy as np
  #Page 87 of 2nd Edition
  my_arr = np.arange(1000000)
  %time for _ in range(10): my_arr2 = my_arr*2
  </code></pre>
  
  <p>Now, the issue is that <code>%time</code> generates <code>Unresolved reference</code> error in PyCharm editor, although it runs without any error. As a beginner, I have no clue how to fix this. I have completed all the steps in SO: <a href="https://stackoverflow.com/questions/21236824/unresolved-reference-issue-in-pycharm">Unresolved reference issue in PyCharm</a>, <a href="https://stackoverflow.com/questions/29452054/pycharm-unresolved-reference-when-importing-class-from-other-file?noredirect=1&amp;lq=1">PyCharm unresolved reference when importing class from other file</a> by doing this:</p>
  
  <p>a) fixing interpreter - Anaconda 3.6</p>
  
  <p>b) adding project path as source and to sys.path</p>
  
  <p>c) Installing IPython from PyCharm</p>
  
  <p>d) Clear cache and restart -- I have done this three times already......</p>
  
  <p>Please note that when I run <code>%time%...</code> by selecting that line, I don't get an error. Alternatively, if I run this directly in Python Terminal, I don't get an error at all.</p>
  
  <p>Red underlines are very annoying. I'd appreciate if someone could guide me how to fix this.<a href="https://i.stack.imgur.com/1ecfh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1ecfh.png" alt="enter image description here"></a></p>