Why Python ggplot returns name 'aes' is no

2019-06-16 21:47发布

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?

1条回答
我命由我不由天
2楼-- · 2019-06-16 22:22

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 *
查看更多
登录 后发表回答