1

I am a newbie and the following question may be dumb and not well written. I tried the following block of codes in Ipython:

%pylab qt5
x = randn(100,100)
y = mean(x,0)
import seaborn
plot(y)

And it delivered a plot. Everything was fine.

However, when I copied and pasted those same lines of codes to Pycharm and tried running, syntax error messages appeared.

For instance,

  • %pylab was not recognized.
  • Then I tried to import numpy and matplotlib one by one. But then, randn(.,.) was not recognized.
DavidG
  • 24,279
  • 14
  • 89
  • 82
user76911
  • 11
  • 2

1 Answers1

0

You can use IPython/Jupyter notebooks in PyCharm by following this guide: https://www.jetbrains.com/help/pycharm/using-ipython-jupyter-notebook-with-pycharm.html

You may modify code like the snippet below in order to run in PyCharm:

from numpy.random import randn
from numpy import mean
import seaborn

x = randn(10, 10)
y = mean(x, 0)

seaborn.plt.plot(x)
seaborn.plt.show()
Mehmed
  • 2,880
  • 4
  • 41
  • 62