1. 리스트로 구하기
lst = [1,2,3,4,5,6,7,8,9,10]
print(sum(lst) / len(lst))
2. numpy 패키지로 구하기
import numpy as np
np_array = np.array(lst)
print(np_array.mean())
'Programming > Python' 카테고리의 다른 글
| [Pandas] DataFrame 더 많은 행과 열 출력하기 (0) | 2022.09.05 |
|---|---|
| [Python] 문자열 앞에 0을 채우는 방법(zfill, rjust) (0) | 2022.07.16 |
| [Numpy] Numpy 행렬에 함수 적용하기 (0) | 2022.06.28 |
| [Pandas] DataFrame 기간별 데이터 산출하기 (0) | 2022.06.14 |
| [Pandas] DataFrame에서 특정 리스트에 해당하는 열 추출하기 (0) | 2022.06.14 |