gpt4 book ai didi

python - 在 seaborn 中使用 distplot 进行 FutureWarning

转载 作者:太空狗 更新时间:2023-10-30 00:52:51 26 4
gpt4 key购买 nike

<分区>

每当我尝试使用 seaborn 中的 distplot 时,我都会收到此警告,而且我似乎无法弄清楚我做错了什么,抱歉如果它很简单。

警告:

FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result. return np.add.reduce(sorted[indexer] * weights, axis=axis) / sumval

这里是一个可重现的例子:

import numpy as np 
import pandas as pd
import random

import seaborn as sns

kde_data = np.random.normal(loc=0.0, scale=1, size=100) # fake data
kde_data = pd.DataFrame(kde_data)
kde_data.columns = ["value"]
#kde_data.head()

现在,情节是正确的,但我一直收到上面的警告并使用arr[tuple(seq)]而不是arr[seq] 对我帮助不大。

sns.distplot(kde_data.value, hist=False, kde=True)

enter image description here

我正在研究 Jupyter,这是模块版本:

seaborn==0.9.0
scipy==1.1.0
pandas==0.23.0
numpy==1.15.4

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