일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 파이썬 셀레니움
- 구글 지오코드
- 셀레니움
- 위도경도
- 코딩
- 웹매크로 #세잔느
- #비정형 데이터 #네이버 #지도 #크롤링
- #위도#경도#비정형데이터#크롤링
- #크롤링 #웹문서
- 웹크롤링
- 카카오APi
- 파이썬
- #K-means #Clustering
- 숫자빼고 중복되는 코드동작법
- #비정형#카카오api#api#크롤링
- Today
- Total
목록Data Analysis (116)
지방이의 Data Science Lab
1. numpy 이용 1 2 3 4 a = [1,2,3] output = np.subtract(a, 1) print(output) [0 1 2] 2.List Comprehension 이용 1 2 3 4 a = [1,2,3] output1 = [i-1 for i in a] print(output1) # [0, 1, 2] 3. map 이용 1 2 3 output2 = list(map(lambda x:x -1, a)) print(output2) # [0, 1, 2]
1 2 3 a = [[0]*3 for _ in range(3)] print(a) # [[0, 0, 0], [0, 0, 0], [0, 0, 0]] 매트릭스 만드는 법
1 2 3 4 5 6 7 name = "a" print(ord(name)) #97 print(chr(97)) #a
기본형태: df.query('컬럼명 > 1') .query는 내게 세상 편하다. 이게 조금더 머리에 잘 박히는 것 같다. 다만 알아야하는 부분이 몇가지 존재한다. (1) 컬럼명에 스페이스 바가 있는 경우: ` ` 사용 1 no_genres_list = genres.query('`(no genres listed)` == 1').index (2) dtypes에 숫자/string 확인하고 맞춰야 함: string인 경우 " " 사용 1 yr1993_list = movies.query('year == "1993"').index (3)리스트로 가지고 있는 경우: @ 사용 1 2 3 4 5 6 7 8 ratings.query('movieId in @yr1993_list')['rating'].mean() output..
1 2 3 4 5 6 7 movies1['year'] = movies1['title'].str.extract('(\(\d\d\d\d\))') movies1.isna().sum() #에러 유무 확인 movies1.dropna(axis=0, inplace=True) movies1['year'] = movies1['year'].apply(lambda x: str(x).replace('(','').replace(')','')) movies1.head()
1 genres = movies['genres'].str.get_dummies(sep = '|')
1 2 3 4 col1 = genres.columns[-1:].to_list() col2 = genres.columns[:-1].to_list() new_col = col1+col2 genres = genres[new_col]