python图片测量_Python-测量中心趋势

作者:神秘网友 发布时间:2020-09-25 20:33:15

python图片测量_Python-测量中心趋势

python图片测量_Python-测量中心趋势 python图片测量_Python-测量中心趋势

python图片测量

Python-测量中心趋势 (Python - Measuring Central Tendency)



Advertisements 广告 Previous Page 上一页 Next Page   下一页

Mathematically central tendency means measuring the center or distribution of location of values of a data set. It gives an idea of the average value of the data in the data set and also an indication of how widely the values are spread in the data set. That in turn helps in evaluating the chances of a new input fitting into the existing data set and hence probability of success.

数学上的中心趋势是指测量数据集值的中心或位置分布。 它给出了数据集中数据平均值的概念,并指出了这些值在数据集中分布的范围。 反过来,这有助于评估将新输入拟合到现有数据集中的机会,从而评估成功的可能性。

There are three main measures of central tendency which can be calculated using the methods in pandas python library.

可以使用pandas python库中的方法计算出集中趋势的三种主要度量。

  • Mean - It is the Average value of the data which is a division of sum of the values with the number of values.

    均值-它是数据的平均值,是值的总和除以值的数量。

  • Median - It is the middle value in distribution when the values are arranged in ascending or descending order.

    中位数-当值以升序或降序排列时,它是分布中的中间值。

  • Mode - It is the most commonly occurring value in a distribution.

    模式-它是分布中最常见的值。

The pandas functions can be directly used to calculate these values.

熊猫函数可以直接用于计算这些值。

import pandas as pd

#Create a Dictionary of series
d = {'Name':pd.Series(['Tom','James','Ricky','Vin','Steve','Smith','Jack',
   'Lee','Chanchal','Gasper','Naviya','Andres']),
   'Age':pd.Series([25,26,25,23,30,29,23,34,40,30,51,46]),
   'Rating':pd.Series([4.23,3.24,3.98,2.56,3.20,4.6,3.8,3.78,2.98,4.80,4.10,3.65])}

#Create a DataFrame
df = pd.DataFrame(d)
print "Mean Values in the Distribution"
print df.mean()
print "*******************************"
print "Median Values in the Distribution"
print df.median()

Its output is as follows ?

输出如下-

Mean Values in the Distribution
Age       31.833333
Rating     3.743333
dtype: float64
*******************************
Median Values in the Distribution
Age       29.50
Rating     3.79
dtype: float64

Mode may or may not be available in a distribution depending on whether the data is continous or whether there are values which has maximum frquency. We take a simple distribution below to find out the mode. Here we have a value which has maximum frequency in the distribution.

根据数据是连续的还是有最大频率的值,模式在分发中是否可用。 我们通过下面的简单分布来找出模式。 在这里,我们有一个在分布中具有最大频率的值。

import pandas as pd

#Create a Dictionary of series
d = {'Name':pd.Series(['Tom','James','Ricky','Vin','Steve','Smith','Jack',
   'Lee','Chanchal','Gasper','Naviya','Andres']),
   'Age':pd.Series([25,26,25,23,30,25,23,34,40,30,25,46])}
#Create a DataFrame
df = pd.DataFrame(d)

print df.mode()

Its output is as follows ?

输出如下-

python图片测量_Python-测量中心趋势
     Age      Name
0   25.0    Andres
1    NaN  Chanchal
2    NaN    Gasper
3    NaN      Jack
4    NaN     James
5    NaN       Lee
6    NaN    Naviya
7    NaN     Ricky
8    NaN     Smith
9    NaN     Steve
10   NaN       Tom
11   NaN       Vin

Previous Page Print Page 上一页 打印页面 Next Page   下一页 Advertisements 广告

翻译自: https://www.tutorialspoint.com/python_data_science/python_measuring_central_tendency.htm

python图片测量

python图片测量_Python-测量中心趋势相关教程

  1. 一个简单的python爬虫程序

    一个简单的python爬虫程序 概述 这是一个简单的python爬虫程序,仅用作技术学习与交流,主要是通过一个简单的实际案例来对网络爬虫有个基础的认识。 什么是网络爬虫 简单的讲,网络爬虫就是模拟人访问web站点的行为来获取有价值的数据。专业的解释:百度百科

  2. python 逻辑回归案例_Python中的逻辑回归-案例研究

    python 逻辑回归案例_Python中的逻辑回归-案例研究 python 逻辑回归案例 Advertisements广告 Previous Page 上一页Next Page 下一页 Consider that a bank approaches you to develop a machine learning application that will help them in identifying th

  3. python 逻辑回归_Python中的逻辑回归-摘要

    python 逻辑回归_Python中的逻辑回归-摘要 python 逻辑回归 Advertisements广告 Previous Page 上一页Next Page 下一页 Logistic Regression is a statistical technique of binary classification. In this tutorial, you learned how to train the machine

  4. Python进阶学习:可以扫的二维码

    Python进阶学习:可以扫的二维码 程序的起源 二维码想必大家都接触过了吧。但是,你们有没有想到居然可以自己用Python来写一个二维码?没错,我就是这么任性,我要搞些不一样的。 这里给大家我上传的一个安装Python的内建外部模块的程序。 好的,我们现在上代

  5. 使用Python进行机器学习-生态系统

    使用Python进行机器学习-生态系统 使用Python进行机器学习-生态系统 (Machine Learning with Python - Ecosystem) Advertisements广告 Previous Page 上一页Next Page 下一页 Python is a popular object-oriented programing language having the capabiliti

  6. python数据拆分_Python中的逻辑回归-拆分数据

    python数据拆分_Python中的逻辑回归-拆分数据 python数据拆分 Python中的逻辑回归-拆分数据 (Logistic Regression in Python - Splitting Data) Advertisements广告 Previous Page 上一页Next Page 下一页 We have about forty-one thousand and odd records.

  7. python 逻辑回归_Python中的逻辑回归-简介

    python 逻辑回归_Python中的逻辑回归-简介 python 逻辑回归 Advertisements广告 Previous Page 上一页Next Page 下一页 Logistic Regression is a statistical method of classification of objects. This chapter will give an introduction to logistic re

  8. python基础一

    python基础一 python基础一 一,Python介绍 [1.python的出生与应用] [2.python是什么编程语言。] [3.python的优缺点。] [4.python的种类。] [二,python环境] [三,python基础初始] [1.运行python代码] [2.解释器] [3.注释] [4.变量] [5.常量] [6.基础数据类