[@ 데코레이터] 원래 함수를 수정하지 않고 추가적인 기능을 구현하는 방법
·
프로그래밍 언어/Python
🎀 데코레이터란?데코레이터(Decorator) = 다른 함수에 기능을 추가하는 함수원래 함수를 바꾸지 않고실행 전후에 기능을 덧붙이기 위해 씀!바로 예시로 알아보자 def decorator_function(original_function): def wrapper_function(): print("함수 실행 전 🎬") original_function() print("함수 실행 후 🎉") return wrapper_function@decorator_functiondef say_hello(): print("안녕~ 👋")say_hello() 함수 실행 전 🎬 안녕~ 👋 함수 실행 후 🎉 Sum.@decorator_function데코레이터 함수..
[Syntax] 예외처리 , try/except/finally/assert
·
프로그래밍 언어/Python
01. 문법오류 발생시 → 에러종류, 에러메시지 표시 - 구조 : 조건에 맞으면 pass , 안맞으면 에러 메시지 표현 for i in range(5) print('예외처리') for i in range(5) ^ SyntaxError: invalid syntax 02. 예외처리 -에러가 발생할 상황이라도 코드가 멈추지 않고 pass되도록 하고 싶을때 사용 try: 예외가 발생할 가능성이 있는 코드 except [ 처리할 예외명 [ as 에러 메시지 변수 ]]: try 절에서 발생한 예외를 처리할 코드 [ else: ] try 절에서 예외가 발생하지 않았을 경우에만 실행될 코드 [ finally: ] try 절이 실행되고 나면 언제나 마지막에 실행될 코드 - assert 문 - assert [조건], [에..
파이썬 프로토타입 라이브러리_streamlit _
·
프로그래밍 언어/Python
https://zzsza.github.io/mlops/2021/02/07/python-streamlit-dashboard/ Python Streamlit 사용법 - 프로토타입 만들기 Python Streamlit에 대한 글입니다 python streamlit tutorial, python streamlit dashboard, python streamlit install, python streamlit vs dash, python dashboard, python streamlit example zzsza.github.io
파라미터 config 폴더로 관리하기(argparse, yaml) 이용
·
프로그래밍 언어/Python
파라미터 config 폴더로 관리하기(argparse, ymal) 이용  https://csm-kr.tistory.com/19 python model config 하기 - configuration (argparse, ymal) 이용안녕하세요~ pulluper 입니다. 오늘은 deep neural network 를 학습할 때, 그 구성을 변경하는데 많이 쓰이는 argparse 와 ymal 에 대하여 알아보겠습니다. 😊 대규모 혹은 논문을 위한 실험은 여러가지의 구csm-kr.tistory.comhttps://csm-kr.tistory.com/19 python model config 하기 - configuration (argparse, ymal) 이용안녕하세요~ pulluper 입니다. 오늘은 deep n..
'\n'개행변수 삭제
·
프로그래밍 언어/Python
https://m.blog.naver.com/PostView.nhn?blogId=popqser2&logNo=221399436541&proxyReferer=https:%2F%2Fwww.google.com%2F 파이썬 - strip in list (리스트에서 문자 삭제 사용하기) (feat. rstrip, lstrip) 0x00 서론텍스트 파일을 open 하여 내용을 읽어 올 때 개행으로 구분되어 있으면, '\n' 문자가 붙어서 들어... blog.naver.com
f string 소수점 표기 법 print(f'{loss :.2f}')
·
프로그래밍 언어/Python
f string 소수점 표기 법 print(f'{loss :.2f}')
데이터 순서 역순으로 바꾸기, 뒤집기 flip/reverse
·
프로그래밍 언어/Python
데이터 순서 역순으로 바꾸기, 뒤집기 flip/reverse https://codetorial.net/tips_and_examples/reverse_python_list_or_numpy_array.html 3. 파이썬 리스트 순서 뒤집기 - Codetorial 4) np.flip() vs np.flipud() vs np.fliplr() np.flip(), np.flipud(), np.fliplr() 메서드의 차이에 대해 알아봅니다. 2차원 어레이에서 세가지 메서드는 다르게 동작합니다. np.flip() vs np.flipud() vs np.fliplr(). np.flip()은 �� codetorial.net
logging 모듈
·
프로그래밍 언어/Python
logging 모듈 https://greeksharifa.github.io/%ED%8C%8C%EC%9D%B4%EC%8D%AC/2019/12/13/logging/#3-format-%ED%8E%B8%EB%A6%AC%ED%95%98%EA%B2%8C-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0 Python, Machine & Deep Learning Python, Machine Learning & Deep Learning greeksharifa.github.io