Seaborn tsplot 错误 [英] Seaborn tsplot error

查看:53
本文介绍了Seaborn tsplot 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am running the following code and getting this issue -

"/usr/local/lib/python2.7/dist-packages/seaborn/timeseries.py:183: UserWarning: 不推荐使用 tsplot 函数,将来将被删除或替换(在一个实质性改变的版本中)释放.警告.警告(味精,用户警告)".

"/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) ".

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

Does anybody know how to fix this issue?

代码-

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().

As per the comments: This is a warning, not an error. You are being warned that a function that you use will be removed from Seaborn in the future. Either ignore the warning or use some other function instead, such as plt.plot() from matplotlib.pyplot.

这篇关于Seaborn tsplot 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆