Hugo
Hugo

Reputation: 1698

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?

Upvotes: 8

Views: 9068

Answers (1)

Thomas Orozco
Thomas Orozco

Reputation: 55283

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 *

Upvotes: 14

Related Questions