Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 카카오APi
- #K-means #Clustering
- 셀레니움
- 웹매크로 #세잔느
- #크롤링 #웹문서
- 숫자빼고 중복되는 코드동작법
- 코딩
- #위도#경도#비정형데이터#크롤링
- #비정형 데이터 #네이버 #지도 #크롤링
- 파이썬 셀레니움
- 웹크롤링
- 파이썬
- #비정형#카카오api#api#크롤링
- 위도경도
- 구글 지오코드
Archives
- Today
- Total
지방이의 Data Science Lab
[python] 시간컬럼을 카테고리로 변경 본문
hrs = trade.time.astype(str).apply(lambda x: x.split(':')[0]).astype(float) hrs = hrs.to_frame('hrs') trade= pd.concat([trade,hrs],axis=1) def get_part_of_day(hour): return ( "morning" if 5 <= hour <= 11 else "afternoon" if 12 <= hour <= 17 else "evening" if 18 <= hour <= 22 else "night" ) trade['part_of_day'] = [get_part_of_day(x) for x in trade['hrs']]
|
'Data Analysis > Python' 카테고리의 다른 글
[python] 데이터 셋 쪼개기 유저기준으로 (0) | 2019.08.04 |
---|---|
[python] 데이터 타입 바꾸기 (0) | 2019.07.29 |
[python] array속 비교 (0) | 2019.07.28 |
[python] 날짜에서 연도, 월, 일 추출 (0) | 2019.07.25 |
[python] 유저아이디별로 5줄씩만 가져오기 (0) | 2019.07.23 |
Comments