본문 바로가기

Python/Data Analysis Library

(13)
Part03 Chapter.02 데이터 분석 라이브러리 05. Pandas DataFrame Pandas DataFrame Pandas DataFrame : pandas 라이브러리가 사용하는 기본 자료구조. DataFrame은 2차원 테이블 구조를 말한다. 1차원 구조인 Series 도 있다. (1 row, 1 column) row, column으로 모든 원소를 구분한다. (indexing) index, columns, values라는 객체 변수를 가지고 있다. Relational DB와 완전히 호환됩니다. 하나의 column을 기준으로 모든 원소의 data type이 동일합니다. (모두 numpy array가 가지는 data type과 동일) DataFrame은 numpy array를 상위 호환하는 개념으로 universal function이 사용 가능합니다. → 내부 구현체로 numpy ar..
Part03 Chapter.02 데이터 분석 라이브러리 04. Pandas를 사용하는 이유 Pandas! Pandas : Python Data Analysis Library. 정형 데이터 분석에 최적화된 라이브러리. https://pandas.pydata.org/ pandas - Python Data Analysis Library pandas pandas is a fast, powerful, flexible and easy to use open source data analysis and manipulation tool, built on top of the Python programming language. Install pandas now! pandas.pydata.org 2008년에 만들어졌으며, 2009년에 100% 오픈소스가 되었다. 정형 데이터를 효율적으로 표현할 수 있는 DataFr..
Part03 Chapter.02 데이터 분석 라이브러리-03. Numpy method (실습) Numpy 1. Numpy Array and Operation numpy의 기본적인 사용법에 대해서 배워봅니다. numpy에서 numpy.array를 만드는 여러가지 방법과 지원하는 연산자에 대해서 공부합니다. 1.1. Numpy Array creation # numpy 라이브러리를 불러옵니다. import numpy as np # 파이썬 리스트 선언 data = [1, 2, 3, 4, 5] # 파이썬 2차원 리스트(행렬) 선언 data2 = [[1,2],[3,4]] # 파이썬 list를 numpy array로 변환합니다. # numpy array를 만드는 방식의 대부분은 파이썬 리스트를 np.array로 변환하는 방식입니다. arr = np.array(data) arr >>> array([1, 2, 3..
Part03 Chapter.02 데이터 분석 라이브러리 02. Numpy array Numpy array Numpy array : numpy에서 사용되는 기본적인 자료구조. numpy array는 C언어의 array 구조와 동일한 개념입니다. (TMI : C array) numpy array는 파이썬 리스트와 비슷한 구조입니다. 하지만, 세부적인 특징이 많이 다릅니다. 선언한 이후에 크기 변경이 불가능합니다. 모든 원소의 데이터 타입이 동일해야 합니다. (homogeneous array) indexing으로 원소를 접근할 수 있습니다. 생성 후 assignment operator를 이용해서 원소의 update가 가능합니다. numpy가 제공하는 데이터 타입은 파이썬과 다릅니다. 수치와 관련된 데이터 타입이 대부분입니다. 원소의 크기(memory size)를 조절할..
Part 03 Chapter.02 데이터 분석 라이브러리 01. Numpy를 사용하는 이유 Numpy Numpy : Numerical computing with Python. 수치연산 및 벡터 연산에 최적화된 라이브러리. Numpy! https://numpy.org/ NumPy Powerful N-dimensional arrays Fast and versatile, the NumPy vectorization, indexing, and broadcasting concepts are the de-facto standards of array computing today. Numerical computing tools NumPy offers comprehensive mathematical functions, random number g numpy.org 2005년에 만들어졌으며, 100% 오픈소스입니..