Python은 프로그래밍 언어입니다. 프로그래밍 언어중에서도 코드가 간단하며 접근성이 뛰어납니다.
R언어라는 통계 표준 플랫폼이 있음에도 파이썬을 통해 데이터분석을 하는건 위와 같은 이점이 있기 때문입니다.
파이썬을 이용해서 데이터분석을 하려면 간단하게 라이브러리를 추가하면 됩니다. (ex pandas numpy matplotlib 등)
즉, 쉬운 프로그래밍 언어인 Python을 이용해서 데이터 분석을 하기 위해 만들어진 라이브러리가 Pandas입니다.
pandas.pydata.org/docs/index.html
pandas documentation — pandas 1.2.1 documentation
API reference The reference guide contains a detailed description of the pandas API. The reference describes how the methods work and which parameters can be used. It assumes that you have an understanding of the key concepts.
pandas.pydata.org
Pandas는 데이터를 다루기 위해서 1) Series, 2) DataFrame 이라는 자료 구조(Data Structure)를 사용합니다.
Series는 엑셀 시트(Sheet)의 열 1개를 생각하면 이해하기 쉽습니다.
데이터프레임은 Series의 조합(열의 합)으로 이루어져 있으며 엑셀이나 구글의 스프레드 시트와 매우 유사한 개념입니다.
데이터프레임(DataFrame)의 구성 요소
데이터프레임은 크게 세가지 구성 요소를 가지고 있습니다. 1) 행(index), 2) 열(columns), 3) 값(values)입니다. 각각의 구성 요소는 데이터프레임의 속성을 이용해서 확인할 수 있습니다.

데이터 프레임의 여러가지 데이터 포맷
Wide and Tidy

Wide to Tidy
pandas.DataFrame.melt — pandas 1.2.1 documentation
If True, original index is ignored. If False, the original index is retained. Index labels will be repeated as necessary.
pandas.pydata.org
데이터의 재구조화 (pivot)

pivot
pandas.DataFrame.pivot — pandas 1.2.1 documentation
Column to use to make new frame’s columns. Changed in version 1.1.0: Also accept list of columns names.
pandas.pydata.org
pivot_table
pandas.pivot_table — pandas 1.2.1 documentation
This only applies if any of the groupers are Categoricals. If True: only show observed values for categorical groupers. If False: show all values for categorical groupers. Changed in version 0.25.0.
pandas.pydata.org
'데이터 분석 > 전처리 및 EDA' 카테고리의 다른 글
| cheat sheet (0) | 2021.02.23 |
|---|---|
| 선형모델이란? (0) | 2021.01.28 |
| Pandas 기본설정 (0) | 2020.12.31 |