AtributeError: 'module' object has no attribute 'plt' - Seaborn

后端 未结 5 1910
没有蜡笔的小新
没有蜡笔的小新 2021-01-07 20:05

I\'m very new with these libraries and i\'m having troubles while plotting this:

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
im         


        
5条回答
  •  北荒
    北荒 (楼主)
    2021-01-07 20:15

    Can't comment because low reputation (newbie here)

    I just want to confirm that I got the same error using Jupyter inside Anaconda (Feb 2018). Got the code from here but the error occured. It turns out that I need to simply add

    import matplotlib.pyplot as plt
    

    on top of

    import seaborn as sns
    

    and it work just fine using plt.show() instead of sns.plt.show()

提交回复
热议问题