Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Python ggplot returns name 'aes' is not defined?

When I use the following comand

p = ggplot(aes(x='DTM',y='TMP1'), data=data)

I get the following error

NameError: name 'aes' is not defined

Could you help me?

like image 334
Hugo Avatar asked May 04 '14 14:05

Hugo


1 Answers

You need to import aes:

from ggplot import aes

Alternatively, you can just import everything in the ggplot namespace (though * imports are usually frowned upon as they make it difficult to track down where a name is coming from):

from ggplot import *
like image 158
Thomas Orozco Avatar answered Sep 28 '22 20:09

Thomas Orozco