Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: module 'seaborn' has no attribute 'tsplot'

Tags:

python

seaborn

I am trying to use seaborn's tsplot function but it is not showing an output. Instead I'm getting an error:

gammas = sns.load_dataset('gammas')
sns.tsplot(time='timepoint',  # 时间数据, x轴
           value='BOLD signal',  # y轴value
           unit='subject',  # 拆分,默认参数
           condition='ROI',  # 分类
           data=gammas
           )
sns.plt.show()

The error:

    "C:\Program Files\Python37\python.exe" C:/Users/42021/PycharmProjects/klyprojects/venv/plt_loss_acc.py
Traceback (most recent call last):
  File "C:/Users/42021/PycharmProjects/klyprojects/venv/plt_loss_acc.py", line 137, in <module>
    plot_loss_acc_seaborn()
  File "C:/Users/42021/PycharmProjects/klyprojects/venv/plt_loss_acc.py", line 43, in plot_loss_acc_seaborn
    sns.tsplot(time='timepoint',  # 时间数据, x轴
AttributeError: module 'seaborn' has no attribute 'tsplot'

seaborn version 0.10.0 python37

Please help.

like image 626
kly Avatar asked Feb 14 '20 17:02

kly


Video Answer


1 Answers

This release also removes a few previously-deprecated features:

The tsplot function and seaborn.timeseries module have been removed. Recall that tsplot was replaced with lineplot().

The seaborn.apionly entry-point has been removed.

The seaborn.linearmodels module (previously renamed to seaborn.regression) has been removed.

refer to:https://seaborn.pydata.org/whatsnew.html

like image 184
hiaduo huang Avatar answered Oct 20 '22 11:10

hiaduo huang