Skip to content

Latest commit

 

History

History
140 lines (114 loc) · 5.25 KB

File metadata and controls

140 lines (114 loc) · 5.25 KB

doxygen

  • drag & drop source code range of function or all text
  • command key + . key

numpy

  • Numpy array 느ㄴ 데이터 불러오기, 삽입, 삭ㅔ, 업ㅔ이트에 있어서 매우 빠름.
  • 일반적인 파이썬 array에 비하여 고급의 브로드캐스트 기능을 제공
  • 고급 수학 및 선형대수 옵션을 지원하는 많은 함수를 가지고 있다.
  • 다차원 array 를 분리해주는 고급 기능을 제공

data type

  • i = integer

  • b = boolean

  • u = unsigned integer

  • f = float

  • c = complex float

  • m = timedelta

  • M = datetime

  • o = Object

  • S = string

  • U = Unicode string

  • V = fixed chunk of memory other type(void)

  • example

standard deviation

reference site

$$ \frac{\sqrt{\sum{(x - \mu)^2}}}{N} $$

correlation coefficient (상관계수)

  • 상관계수(相關係數, 영어: correlation coefficient)는 두 변수 사이의 통계적 관계를 표현하기 위해 특정한 상관 관계의 정도를 수치적으로 나타낸 계수이다.[1]
    여러 유형의 상관계수가 존재하지만 제각기 자신들만의 정의와 특징이 있다. 이들은 모두 값의 범위가 -1에서 +1 사이에 속하며 여기서 ±1은 정도가 가장 센 잠재적 일치를 나타내고 0은 정도가 가장 센 불일치를 나타낸다.[2]

위키백과, 우리 모두의 백과사전.

numpy

pandas

pandas library

import pandas as pd
from pandas import Series, DataFrame
  • table data analysis library.
  • for useful 1 dimension.

install pandas

python3 -m pip install pandas

example code

  • What's the Series library
  • Waht's the DataFrame library
    • two dimesion
    • csv : Comma Seperated Value
      • pd.read_csv(filename, encoding=cp949)
      • filepath : full path or working folder file
      • sep : sepearte word ( default: ',' )
      • encoding : utf-8 or cp949 ( KOR )
      • nrows : read number of row ( nrows ), before big size file
      • header : header row ( default: 0)
      • usecols : select column
      • low_memory : file chunk ( row memory use ), True or False
    • excel : read_excel
      • filepath
      • sheet_name : excel sheet name
        • [0, 1, "sheet5"] : get data sheets ( dataframe ) that first, second, name of "sheet5"
      • usecols
      • nrows
      • na_values : change NA/NaN values to "any string"
        • example) na_values = ['NA']
    • from_records
      • from_records()
        • tuple list, list of list, dictionary list, DataFrame list
    • dataframe example
      • dataframe.iloc([0:2,1:3]) : row - 0,1 column - 1,2
      • dataframe.loc([0:2, 1:3]) : row - 0,1,2
  • example csv files
  • dataframe check
    • astype()
      • astype('int64'), astype('str'), astype('float64'), astype('datetime64[ns,US/Easterm]')
    • to_numeric()
      • df['차변금액'] = pd.to_numeric(df['차변금액'])
    • to_datetime()
      • pd.to_datetime('20201010', format='%Y%m%d')
    • 기술통계량 (평균, 표준편차, 분산, 최대값, 최소값 ) - describe()
      • df.describe()