熊猫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.
让我们开始吧。
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:
数据文件如下所示:
By Author 按作者Now, let’s see what plots can we apply on our data.
现在,让我们看看可以将哪些图应用于数据。
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) Histogram — By Author 直方图—作者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') Scatter — By Author 散点图—作者Each Bar represents the category and its value on the y-axis.
每个条形图代表类别及其在y轴上的值。
data.plot.bar() Bar — By Author 酒吧—作者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新功能介绍
相关资源:四史答题软件安装包exe