gpt4 book ai didi

python - Seaborn tsplot 错误

转载 作者:太空宇宙 更新时间:2023-11-04 05:00:38 26 4
gpt4 key购买 nike

我正在运行以下代码并遇到此问题 -

"/usr/local/lib/python2.7/dist-packages/seaborn/timeseries.py:183: UserWarning: The tsplot function is deprecated and will be removed or replaced (in a substantially altered version) in a future release. warnings.warn(msg, UserWarning) ".

有人知道如何解决这个问题吗?

代码-

import numpy as np
import tensorflow as tf
import seaborn as sns
import pandas as pd

SEQ_LEN = 10
def create_time_series():
freq = (np.random.random()*0.5) + 0.1 # 0.1 to 0.6
ampl = np.random.random() + 0.5 # 0.5 to 1.5
x = np.sin(np.arange(0,SEQ_LEN) * freq) * ampl
return x

for i in xrange(0, 5):
sns.tsplot( create_time_series() ); # 5 series

最佳答案

根据评论:这是一个警告,而不是错误。您被警告您使用的功能将来会从 Seaborn 中删除。要么忽略警告,要么改用其他函数,例如 matplotlib.pyplot 中的 plt.plot()

关于python - Seaborn tsplot 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45831596/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com