Python programming(31)
-
그래프를 그려요 - matplotlib
(1) matplotlib 를 활용해요 - 공식 문서는 여기 참조 - 한 그래프를 여러 조각으로 나눠서 그래프 동시에 그릴 때 ex) fig = plt.figure() ax1 = fig.add_subplot(2,1,1) ax2 = fig.add_subplot(2,1,2) ax1.plot(unrate[0:12]['DATE'], unrate[0:12]['VALUE']) ax2.plot(unrate[12:24]['DATE'], unrate[12:24]['VALUE']) plt.show() (2) 바그래프 그리기 예제 ) num_cols = ['RT_user_norm', 'Metacritic_user_nom', 'IMDB_norm', 'Fandango_Ratingvalue', 'Fandango_Stars'] b..
2019.11.25 -
Pandas 를 써봐요
(1) 시리즈series = 1D pandas object, dataframe = a 2D pandas object (2) 행과 열 (3) dataframe의 특정 row, column 선택하기 - label로 선택하기 : dataframe.loc df.loc[row_label, column_label] - index로 선택하기 : dataframe.iloc The table below summarizes how we can use DataFrame.iloc[] and Series.iloc[] to select by integer position: Select by integer position Explicit Syntax Shorthand Convention Single column from dataf..
2019.11.23 -
CLASS 를 이해해요
(1) fuction 과 class 차이 Pascal Case : LikeThis (첫 글자 대문자, 띄어쓰기 없음) Snake Case : like_this (소문자, 띄어쓰기 언더라인) (2) Pass The pass statement is useful if you're building something complex and you want to create a placeholder for a function that you will build out later without causing your code to error. (3) fuction vs class While a function can be used with any object, each class has its own set of me..
2019.11.21 -
변수별 freq 만들기 2019.11.21
-
format 2019.11.12
-
Numpy 랑 친해져요
(1) n-dimension array - one-dimensional (1D) ndarrays. - two-dimensional array (2) 계산 : 한 줄씩 하는 것보다 같은 procedure 라면 여러 줄 한번에 더하는 게 빠르쥬. 이런걸 'vectorization'이라고 합니다 (3)
2019.11.11 -
tuple
(1) tuple은 immutable 합니동 (2) 한 번에 두 개 이상의 값을 return 하고 싶다면 , 를 써주세요
2019.11.11 -
dictionary 활용하기
(1) dictionary는 정수interger로 값을 간직한다 : hash( ) 해보면 알 수 있음 (2) dictionary 에서의 boolean 처리와 key가 반복될 때. key의 중복이 있으면 마지막 value만 남는다. (3) dictionary에서 key가 있는지 없는지 찾을 수 있다. 단 value가 있는지 없는지는 알 수 없다. (4) dictionary 안에서 value 업데이트하기 (5) dictionary에서 for문 (반복문) 쓰는 법 (6) dictionary로 빈도표 만들어보기 - elif
2019.10.19 -
list에서 가로 값 추가, 오른쪽에 값붙이기 : append()
(3) labeling도 가능
2019.10.17 -
iteration 2019.10.17