일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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#api#크롤링
- #크롤링 #웹문서
- #K-means #Clustering
- #위도#경도#비정형데이터#크롤링
- 위도경도
- 웹매크로 #세잔느
- 파이썬 셀레니움
- 코딩
- 웹크롤링
- 숫자빼고 중복되는 코드동작법
- 파이썬
- 셀레니움
- 구글 지오코드
- 카카오APi
- Today
- Total
목록Data Analysis/Python (38)
지방이의 Data Science Lab

1 2 3 4 col1 = genres.columns[-1:].to_list() col2 = genres.columns[:-1].to_list() new_col = col1+col2 genres = genres[new_col]
index가 같은 이름이라면 df가 달라도 join 가능하다. 1 2 본데이터 = 본데이터.assign(새로운컬럼명 = lambda x: 가져오고싶은df['가져올df내 컬럼명'].loc[x.index]) genres = genres.assign(title = lambda x: movies['title'].loc[x.index])

1 2 3 movies = pd.read_csv('data/movies.csv', encoding='utf-8') genres = [x.split('|') for x in movies['genres'].values] genres = list(set(sum(genres, [])))
숫자 반올림 1 2 3 a = "%0.4f" %3.141592 print(a) # 3.1416

간단 요약: 관리자 권한으로 anaconda prompt 열고, conda install -c r r-essentials 실행 R을 이용하지 않아도 깔 수 있습니다. install.packages('devtools') devtools::install_github('IRkernel/IRkernel') install.packages(c('rzmq','repr','IRkernel','IRdisplay'),repos = c('http://irkernel.github.io/', getOption('repos')), type = 'source') IRkernel::installspec(user = FALSE) quit() 아마 아래 코드 검색하다가 들어오셨을 수 도 있겠네요. 1 2 3 4 5 6 7 > IRker..

temp1 = ['One', 'Two', 'Three', 'Four'] temp2 = ['One', 'Two'] 가 있을 때, temp3 = ['Three', 'Four']를 얻어내자. 1 2 s = set(temp2) temp3 = [x for x in temp1 if x not in s]
cv_id['train'][0] ==> '1,10,100' cv_id['train'][0].split(",") ==>'1', '10', '100' train0 = [int(i) for i in cv_id['train'][0].split(",")] ==>[1, 10,100]
imbalance일때 학습시키려면 계층유지셔커서 쪼개는 방법 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 X = flatten.drop('KIS_credit_&_2018',axis=1) y = flatten['KIS_credit_&_2018'] #방법1 from sklearn.model_selection import train_test_split train_test_split(X, y, random_state=0, stratify=y, shuffle=True) train=flatten.iloc[train_inds] test=flatten.iloc[test_inds] #방법2 from sklearn.model_selecti..