• 회원가입
  • 로그인
  • 구글아이디로 로그인

[module] Python - statistics.mean() 메서드 ★ - 평균값 (= mean메서드 = 민메서드)

1854  

목차

  1. statistics.mean() 예제 - 평균값 구하기.
  2. statistics.mean() 정의
  3. statistics.mean() 구문

 

statistics.mean() 예제 - 평균값 구하기.

 

import statistics

print(statistics.mean([1, 2, 3, 4, 5])) # 3

print(statistics.mean([-3, 5.5, -5.5, 15])) # 3.0

 

 

statistics.mean() 정의

 

주어진 데이터의 평균값 구하기.

※ 평균 = 합계 / 개수

※ Python 3.4 이상.

 


statistics.mean() 구문

 

statistics.mean(data)

 


[매개변수]

 

data

필수. 최소 1개 이상 데이터 있는 숫자 시퀀스.
※ 시퀀스 예: List, Tuple, Set 등

※ data 없는 경우, StatisticsError 에러 반환.

 


[반환값]

 

float 자료형의 평균값.

 



분류 제목
module Python - statistics.stdev() 메서드 -
module Python - statistics.pvariance() 메서드 -
module Python - statistics.variance() 메서드 -
module Python - math 모듈 메서드・상수 종류 (※ 수학 모듈)
module Python - math.acos() 메서드 -
module Python - math.acosh() 메서드 -
module Python - math.asin() 메서드 -
module Python - math.asinh() 메서드 -
module Python - math.atan() 메서드 -
module Python - math.atan2() 메서드 -
module Python - math.atanh() 메서드 -
module Python - math.ceil() 메서드 ★ - 천장 반올림 (= 상위 정수로 반올림. = ceil메서드…
module Python - math.comb() 메서드 -
module Python - math.copysign() 메서드 -
module Python - math.cos() 메서드 -
module Python - math.cosh() 메서드 -
module Python - math.degrees() 메서드 -
module Python - math.dist() 메서드 -
module Python - math.erf() 메서드 -
module Python - math.erfc() 메서드 -
3/7
목록
찾아주셔서 감사합니다. Since 2012