熊猫tv新功能介绍_大熊猫内置可视化功能

熊猫tv新功能介绍

Pandas is a great tool for managing and importing your data. And with this easy and small tutorial, I will go take you through some of the important and fast functions to plot your data with out the need to use matplotlib.

P andas是用于管理和导入数据的出色工具。 在这个简单易用的教程中,我将带您通过一些重要而又快速的函数来绘制数据,而无需使用matplotlib。

Let’s get started.

让我们开始吧。

使用熊猫导入数据: (Import data using pandas:)

First, we need to import the CSV file which we’ll apply the functions on.

首先,我们需要导入CSV文件,并将其应用到功能上。

data = pd.read_csv('df3')data.head()

This is how the data file look like:

数据文件如下所示:

Image for post
By Author
按作者

Now, let’s see what plots can we apply on our data.

现在,让我们看看可以将哪些图应用于数据。

1.直方图: (1. Histogram:)

Plot the frequency of data. Frequency means how many times a range of values appeared. We can define the range by something called bins, it’s how many divisions we’ll split the data to.

绘制数据频率。 频率表示一个值范围出现多少次。 我们可以通过称为bin的方式定义范围,这是将数据划分为多少个分区。

For example if we want to plot the histogram for column ‘a’, we run this line and set the bins for 20.

例如,如果要绘制列“ a”的直方图,则运行此行并将bin设置为20。

data['a'].plot.hist(bins=20)
Image for post
Histogram — By Author
直方图—作者

2.分散:(2. Scatter:)

Scatter here represents the data values in form of dots with respect to two different numeric variables.

此处的散点图表示相对于两个不同数字变量的点形式的数据值。

We do that by running this line:

我们通过运行以下行来做到这一点:

data.plot.scatter(x='A',y='B')
Image for post
Scatter — By Author
散点图—作者

3.酒吧:(3. Bar:)

Each Bar represents the category and its value on the y-axis.

每个条形图代表类别及其在y轴上的值。

data.plot.bar()
Image for post
Bar — By Author
酒吧—作者

结论(Conclusion)

These are the most important and used functions for plotting with pandas. If you want more of this you can find at this link. I hope this article is useful.

这些是绘制熊猫最重要和最常用的功能。 如果您想要更多这些,可以在此链接中找到。 希望本文对您有所帮助。

Thank you.

谢谢。

翻译自: https://medium.com/swlh/pandas-builtin-visualization-functions-529e452f805a

熊猫tv新功能介绍

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值