목록전체 글 (37)
고래밥 이야기

다음을 참고하였습니다. 05-1 클래스 - 점프 투 파이썬 (wikidocs.net) 05-1 클래스 초보 개발자들에게 클래스(class)는 넘기 힘든 장벽과도 같은 존재이다. 독자들 중에도 클래스라는 단어를 처음 접하는 이들도 있을 것이다. 그러면 도대체 클래스가 무엇인지, 클… wikidocs.net 용어 설명 class(클래스) : 과자 틀 object(객체) : class로 만든 것 (과자 틀에 의해서 만들어진 과자) instance(인스턴스) : 거의 객체와 개념이 같다. 하지만 객체는 그 자체로 쓰이고, 인스턴스는 클라스와 같이 쓰인다. 예시로 a = class()라면, 'a는 객체이다.' 'a는 class의 인스턴스이다'로 쓰인다. method(매서드) : 클래스 안에 구현된 함수 - 객체를..
다음 글을 참고하였다. 04-1 함수 - 점프 투 파이썬 (wikidocs.net) 04-1 함수 [TOC] ## 함수란 무엇인가? 함수를 설명하기 전에 믹서를 생각해 보자. 우리는 믹서에 과일을 넣는다. 그리고 믹서를 사용해서 과일을 갈아 과일 주스를 만든다. 우리가 믹… wikidocs.net - 기본 용어 parameter(매개변수) : 함수에 입력으로 전달된 값을 받는 변수 arguments(인수) : 함수를 호출할 때 전달하는 입력값 def add(a, b): # a, b는 매개변수 return a+b print(add(3, 4)) # 3, 4는 인수 - 매개 변수가 여러 개라면..? *을 사용한다. def add_many(*args): result = 0 for i in args: result..
아래를 참고하였습니다. L03_perceptron_slides (sebastianraschka.com) import numpy as np x, w = np.random.rand(100000), np.random.rand(100000) def forloop(x, w): z = 0. for i in range(len(x)): z += x[i] * w[i] return z def listcomprehension(x, w): return sum(x_i*w_i for x_i, w_i in zip(x,w)) def vectorize(x, w): x_vec = np.array(x) w_vec = np.array(w) return x_vec.dot(w_vec) %timeit -r 100 -n 10 forloop(x, ..
다음 사이트를 참고하였습니다. 6. Modules — Python 3.11.0 documentation 05-2 모듈 - 점프 투 파이썬 (wikidocs.net) 05-2 모듈 모듈이란 함수나 변수 또는 클래스를 모아 놓은 파일이다. 모듈은 다른 파이썬 프로그램에서 불러와 사용할 수 있게끔 만든 파이썬 파일이라고도 할 수 있다. 우리는 파이썬으로 프로그… wikidocs.net 6. Modules — Python 3.11.0 documentation 6. Modules If you quit from the Python interpreter and enter it again, the definitions you have made (functions and variables) are lost. Theref..
다음을 참고하였습니다. 5. The import system — Python 3.11.0 documentation 5. The import system — Python 3.11.0 documentation Python code in one module gains access to the code in another module by the process of importing it. The import statement is the most common way of invoking the import machinery, but it is not the only way. Functions such as importlib.import_module() and b docs.python.org import - P..

Built-in magic commands — IPython 8.6.0 documentation Built-in magic commands — IPython 8.6.0 documentation ‘gtk3’, ‘gtk4’, ‘inline’, ‘ipympl’, ‘nbagg’, ‘notebook’, ‘osx’, ‘pdf’, ‘ps’, ‘qt’, ‘qt4’, ‘qt5’, ‘qt6’, ‘svg’, ‘tk’, ‘webagg’, ‘widget’, ‘wx’). If given, the corresponding matplotlib b ipython.readthedocs.io %timeit [-n -r [-t|-c] -q -p -o] statement -n: execute the given statement times i..