본문 바로가기

Data Science/3. 데이터 엔지니어링

[n322]python 활용(2)

■ Key words

  ㆍ

 

■ 주요내용

  ㆍ

 

■ Session note

  ㆍ

 

■ 주요함수

  ㆍ

 

■ Reference

  ㆍgetattr() : https://technote.kr/249

 

Python - getattr(), object의 속성(attribute) 값을 확인하는 함수

getattr >>> getattr(object, name[, default]) object에 존재하는 속성의 값을 가져온다. __builtin__ module에 포함된 function 이다. 예제에 앞서 getattr 예제를 위한 object를 다름과 같이 먼저 생성한다. >>..

technote.kr

  ㆍgetattr() : 

https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=siniphia&logNo=221796316521 

 

[Python] 내장함수 getattr()를 활용해 코드 간소화 시키기

getattr()의 기능 getattr(object, 'name') 이라는 함수는 object라는 오브젝트 내부의 name이라...

blog.naver.com

  ㆍ__init__ method(initializing) : https://wikidocs.net/89

 

위키독스

온라인 책을 제작 공유하는 플랫폼 서비스

wikidocs.net

  ㆍ Decorator(@) : https://bluese05.tistory.com/30

 

python decorator (데코레이터) 어렵지 않아요

Python decorator (데코레이터)  Python 으로 작성된 Opensource 의 코드들을 보다 보면, 아래와 같이 @ 로 시작하는 구문 들을 볼 수 있다. @decorator_ def function(): print "what is decorator?"  decorat..

bluese05.tistory.com

  ㆍ Property()/Getter/Setter : https://www.daleseo.com/python-property/

 

[파이썬] property 사용법 (함수/데코레이터)

Engineering Blog by Dale Seo

www.daleseo.com

  ㆍ 예외 처리(if/try/else/finally/raise) : https://nirsa.tistory.com/117

 

[Python 3.7] 파이썬 예외 처리 (try, except, else, finally, raise)

예외 처리 프로그래밍을 하다보면 여러가지 에러가 발생 합니다. 프로그램이 실행중에 발생하는 에러를 예외라고 부르는데 예외를 무시하고 코드를 실행 시키고 싶을 수 있고, 특정 예외가 발

nirsa.tistory.com

  ㆍ __str__, __repr__ : https://shoark7.github.io/programming/python/difference-between-__repr__-vs-__str__

 

[Python] __str__와 __repr__의 차이 살펴보기

Python에서 객체를 표현하는 두 함수 str, repr의 차이를 알아보겠습니다.

shoark7.github.io

  ㆍpython random 함수 : https://blockdmask.tistory.com/383

 

[python] 파이썬 랜덤함수(random)에 대해서

안녕하세요. BlockDMask 입니다. 오늘은 파이썬에서 랜덤한 수를 구할 수 있는 랜덤함수에 대해서 알아보려고 합니다. 지난번에 파이썬을 이용해서 로또 프로그램을 만들어 봤었는데요. 그때 랜덤

blockdmask.tistory.com

  ㆍ(공식문서)python dataclasses : https://docs.python.org/ko/3/library/dataclasses.html

 

dataclasses — 데이터 클래스 — Python 3.9.6 문서

이 모듈은 __init__() 나 __repr__() 과 같은 생성된 특수 메서드 를 사용자 정의 클래스에 자동으로 추가하는 데코레이터와 함수를 제공합니다. 원래 PEP 557 에 설명되어 있습니다. The member variables to us

docs.python.org

ㆍpython Class : https://wikidocs.net/16071

 

위키독스

온라인 책을 제작 공유하는 플랫폼 서비스

wikidocs.net

  ㆍPEP 8 : https://pep8.org/

 

PEP 8: The Style Guide for Python Code

When implementing ordering operations with rich comparisons, it is best to implement all six operations (__eq__, __ne__, __lt__, __le__, __gt__, __ge__) rather than relying on other code to only exercise a particular comparison. To minimize the effort invo

pep8.org