일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- instance
- pandas
- 다나와
- keras
- matplotlib
- algorithm
- Project
- 애자일
- python
- TypeScript
- Agile
- ECS
- data analyze
- Scrum
- angular
- visualizing
- analyzing
- Crawling
- 자바스크립트
- javascript
- data
- opencv
- AWS
- 프로젝트
- adaptive life cycle
- 크롤링
- tensorflow
- Method
- webcrawling
- DANAWA
- Today
- Total
목록Bigdata/파이썬_Python (21)
LiJell's 성장기
1. Iterator Iterable(반복 가능) 객체 반복자로 요소를 순서대로 읽을 수 있음 for 문과 함께 자주 사용됨 요소를 순회할 반복자 제공 nums = [11,22,33] it = iter(nums) while True: try: num = next(it) except StopIteration: break print(num) ''' 11 22 33 ''' 1.1. Iterator Generator 매번 iterator 관련 메서드를 작성하는 수고를 덜 수 있음 시간과 메모리를 적게 차지해서 많이 사용 yield 값을 반환 return과 유사하나 변수의 마지막 값과 상태를 저장 def seq_gen(data): for idx in range(0, len(data), 2): yield data[..

import pandas as pd import numpy as np np.random.seed(88) df = pd.DataFrame({'A': np.linspace(1,10,10)}) df = pd.concat([df, pd.DataFrame(np.random.randn(10,4), columns = list('BCDE'))], axis= 1) df.iloc[3,3] = np.nan df.iloc[0,2] = np.nan Styling the DataFrame 1. Highlight: 하이라이트 Highlight Min-Max values For highlighting maximum values : chain '.highlight_max()' function to the styler object Ad..
Modified on Jan 10 2022 # -- coding: utf-8 -- """ Created on Wed Dec 29 15:04:23 2021 @author: hanju """ 판다스 연습문제 df1 = pd.read_csv("./data/cancer_test.csv") df1.columns df1.dtypes df1.head() df1.info() df1.describe() 1. radius_mean, texture_mean, texture_se , smoothness_se NA인 행을 제거하고 총 행의 수 리턴 df1['radius_mean'].isnull().sum() df1['texture_mean'].isnull().sum() df1['texture..
Modified on Jan 10 2022 # -- coding: utf-8 -- """ Created on Wed Dec 29 14:14:18 2021 @author: hanju """ 시각화( visualization) df1 = pd.read_csv("./data/cancer_test.csv") df1 ''' id diagnosis ... symmetry_worst fractal_dimension_worst 0 842302 Malignant ... 0.4601 0.11890 1 842517 Malignant ... 0.2750 0.08902 2 84300903 Malignant ... 0.3613 0.08758 3 84348301 Malignant ... 0.6638 0.17300 4 8435840..
Modified on Jan 10 # -_- coding: utf-8 -_- """ Created on Wed Dec 29 11:23:53 2021 @author: hanju """ 17. 날짜표현 월별, 일별, 요일별 집계 현재 날짜 - 입사일자 = 근무 일자 현재 날짜 import numpy as np import pandas as pd from pandas import Series, DataFrame from datetime import datetime datetime.now() # datetime.datetime(2021, 12, 29, 11, 26, 59, 534499) d1 = datetime.now() type(d1) # datetime.datetime d1.year # 연 d1.month ..
Modified on Jan 10 # -- coding: utf-8 -- """ Created on Tue Dec 28 14:56:05 2021 @author: hanju """ 16. NA 결측치 처리, 중복값 제거 (significantly important) NA (결측치) 처리 숫자형 NA (float type), 문자형 NA import numpy as np import pandas as pd from pandas import Series, DataFrame s1= Series([1,2,3,np.nan]) s1 # 0 1.0 # 1 2.0 # 2 3.0 # 3 NaN # dtype: float64 s2 = Series(['a','b','c', np.na..
Modified on Jan 08 2022 # -- coding: utf-8 -- """ Created on Tue Dec 28 14:26:49 2021 @author: hanju """ 15. stack, unstack, pivot_table 자료구조 (데이터타입) 형태 long data(tidy data) 각 속성을 컬럼으로 표현 지점 A B C -wide data(cross table : 교차표) 하나의 속성을 갖는 데이터가 각 종류마다 서로 다른 컬럼으로 분리되어 나열함 A B C 판매량 stack / unstack 1. stack wide ->> long 2. unstack long --> wide import numpy as np import pandas as pd from pandas imp..
Modified on Jan 07 2022 # -- coding: utf-8 -- """ Created on Tue Dec 28 13:14:11 2021 @author: hanju """ 14. drop, shift, rename 1. drop 특정 행, 컬럼 제거 이름 전달 emp = pd.read_csv("./data/emp.csv") emp # empno ename deptno sal # 0 1 smith 10 4000 # 1 2 allen 10 4500 # 2 3 ford 20 4300 # 3 4 grace 10 4200 # 4 5 scott 30 4100 # 5 6 king 20 4000 # scott 퇴사 emp.loc() emp['ename'] =='scott' ..
Modified on Jan 06 2022 # -_- coding: utf-8 -_- """ Created on Mon Dec 27 13:20:27 2021 @author: hanju """ 13. merge vs. concat 행이 서로 분리되어 있는 하나의 데이터프레임으로 합치기 컬럼이 서로 불리되어 있는 하나의 데이터vㅡ레임으로 합치기 참조 조건 사용, 연된된 두 데이터를 병합(join) import pandas as pd import numpy as np from pandas import Series, DataFrame DataFrame(np.arange(1,7).reshape(2,3), columns=\['A','B','C'\]) df1 = DataFr..