I'm trying to import ggplot
into my project, but every time I run my code I get the following ImportError
:
Traceback (most recent call last):
File "C:/Users/Mo/SkyDrive/Python/Udacity/intro_to_ds_programming_files/lesson_4/plotting_python/gg_plot_quiz_student.py", line 2, in <module>
from ggplot import *
ImportError: No module named 'ggplot'
Process finished with exit code 1`
I'm running Python 3.4 (anaconda) and the IDE I'm using is Pycharm. The ggplot
library has ben installed using pip
on the same directory as anaconda
, but still not working. Am I doing something wrong?
The block of code that I'm trying to execute:
def lineplot(hr_year_csv):
data = pd.read_csv(hr_year_csv)
gg = ggplot(data, aes('yearID', 'HR')) + geom_point(color='red') + geom_line(color='red') + ggtitle('title') + xlab('yeadID') + ylab('HR')
print (gg)
lineplot('hr_year.csv')