seaborn_Seaborn Kdeplot –综合指南

seaborn

Hey, folks! In our Seaborn tutorial, we will be focusing on Seaborn Kdeplot.

嘿伙计! 在我们的Seaborn教程中,我们将专注于Seaborn Kdeplot



什么是Kdeplot? (What is Kdeplot?)

Kdeplot is a Kernel Distribution Estimation Plot which depicts the probability density function of the continuous or non-parametric data variables i.e. we can plot for the univariate or multiple variables altogether. Using the Python Seaborn module, we can build the Kdeplot with various functionality added to it.

Kdeplot是一个内核分布估计图,它描述了连续或非参数数据变量的概率密度函数,即,我们可以为单变量或多个变量一起绘制图。 使用Python Seaborn模块 ,我们可以构建带有各种功能的Kdeplot。

In order to use the Seaborn module, we need to install and import the module using the below command:

为了使用Seaborn模块,我们需要使用以下命令安装和导入该模块:


pip install seaborn

import seaborn


创建单变量Seaborn Kdeplot (Creating a Univariate Seaborn Kdeplot)

The seaborn.kdeplot() function is used to plot the data against a single/univariate variable. It represents the probability distribution of the data values as the area under the plotted curve.

seaborn.kdeplot()函数用于根据单个/单变量变量绘制数据。 它将数据值的概率分布表示为绘制曲线下的面积。

Syntax:

句法:


seaborn.kdeplot(data)

Example 1:

范例1:


import seaborn as sn
import matplotlib.pyplot as plt
import numpy as np
data = np.random.randn(200)
res = sn.kdeplot(data)
plt.show()

In the above example, we have generated some random data values using the numpy.random.randn() function.

在上面的示例中,我们使用numpy.random.randn()函数生成了一些随机数据值。

Output:

输出:

  • 0
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值