compution average in python: mean(),pivot_table()
来源:互联网 发布:ubuntu麒麟 下载 编辑:程序博客网 时间:2024/06/03 15:03
import pandas as pd
# This is the same value that we computed in the last screen, but it's much simpler.
# The ease of using the .mean() method is great, but it's important to understand how the underlying data looks.
correct_mean_age = titanic_survival["age"].mean()
correct_mean_fare=titanic_survival["fare"].mean()
print(correct_mean_age)
# This is the same value that we computed in the last screen, but it's much simpler.
# The ease of using the .mean() method is great, but it's important to understand how the underlying data looks.
correct_mean_age = titanic_survival["age"].mean()
correct_mean_fare=titanic_survival["fare"].mean()
print(correct_mean_age)
print(correct_mean_fare)
another way:
passenger_survival = titanic_survival.pivot_table(index="pclass", values="survived", aggfunc=np.mean)
# First class passengers had a much higher survival chance
print(passenger_survival)
passenger_age=titanic_survival.pivot_table(index="pclass",values="age",aggfunc=np.mean)
print(passenger_age)
0 0
- compution average in python: mean(),pivot_table()
- MAP(Mean Average Precision)
- Mean Average Precision
- MAP(Mean Average Precision):
- Mean Average Precision
- Mean Average Precision(MAP)
- MAP(Mean Average Precision)
- Mean Average Precision
- MAP(Mean Average Precision)
- Mean Average Precision vs Mean Reciprocal Rank
- mAP(mean average precision)
- Mean Average Precision(MAP)
- mean average precision(MAP)
- Python中的交叉分析pivot_table
- Python中的结构分析pivot_table
- Multi view Geometry in Compution Vision 学习笔记 第一章
- mean median average 以及mode的区别
- 关于Mean Average Precise的理解
- Android之View的事件体系
- POJ 1273 网络流基础题
- new限定区域分配内存
- linux设备驱动模型之 kset原理与实例分析
- 基于CMakelists的程序调试--QT
- compution average in python: mean(),pivot_table()
- Eclipse安装SVN插件(本地安装)
- XML的解析
- 【Unity3D】本地数据加密_1
- osi七层模型,TCP/IP四层模型
- HDU 1506 Largest Rectangle in a Histogram(dp求最大子矩阵和)
- Maven Plugins
- POJ 1273&Dinic解决
- HDU1032:The 3n + 1 problem(比较运算次数)