箱形图 python
Python-箱形图 (Python - Box Plots)
Boxplots are a measure of how well distributed the data in a data set is. It divides the data set into three quartiles. This graph represents the minimum, maximum, median, first quartile and third quartile in the data set. It is also useful in comparing the distribution of data across data sets by drawing boxplots for each of them.
箱线图是衡量数据在数据集中的分布程度的一种度量。 它将数据集分为三个四分位数。 该图表示数据集中的最小,最大,中位数,第一四分位数和第三四分位数。 通过为每个数据集绘制箱形图来比较数据在数据集之间的分布,这也很有用。
绘制箱形图 (Drawing a Box Plot)
Boxplot can be drawn calling Series.box.plot() and DataFrame.box.plot(), or DataFrame.boxplot() to visualize the distribution of values within each column.
可以通过调用Series.box.plot()和DataFrame.box.plot()或DataFrame.boxplot()来绘制Boxplot,以可视化每个列中值的分布。
For instance, here is a boxplot representing five trials of 10 observations of a uniform random variable on [0,1).
例如,这是一个箱线图,代表对[0,1)上的一个随机变量的10个观测值的五个试验。
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.rand(10, 5), columns=['A', 'B', 'C', 'D', 'E'])
df.plot.box(grid='True')
Its output is as follows
其输出如下-
翻译自: https://www.tutorialspoint.com/python_data_science/python_box_plots.htm
箱形图 python
|