반응형
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 | 29 | 30 | 31 |
Tags
- bccard
- mglearn
- Keras
- web
- 대이터
- 데이터전문기관
- pycharm
- web 사진
- 머신러닝
- classification
- web 용어
- C언어
- broscoding
- 결합전문기관
- 웹 용어
- java역사
- postorder
- vscode
- CES 2O21 참여
- 자료구조
- KNeighborsClassifier
- html
- CES 2O21 참가
- tensorflow
- discrete_scatter
- paragraph
- 재귀함수
- web 개발
- inorder
- cudnn
Archives
- Today
- Total
bro's coding
pandas.dt.(dayofweek,year,month,day,weekday,weekday_name) 본문
[IT]/python.pandas
pandas.dt.(dayofweek,year,month,day,weekday,weekday_name)
givemebro 2020. 4. 24. 10:30반응형
#data_time을 이용해 요일 알아내기
data2.일자.dt.dayofweek

data2['년']=data2.일자.dt.year
data2['월']=data2.일자.dt.month
data2['일']=data2.일자.dt.day
data2['wday']=data2.일자.dt.weekday
data2['wname']=data2.일자.dt.weekday_name
# 0 : 월요일
data2.head()

data2['요일']=data2.일자.dt.weekday.map({0:'월',1:'화',2:'수',3:'목',4:'금',5:'토',6:'일'})
data2.head()

반응형
'[IT] > python.pandas' 카테고리의 다른 글
| pandas.groupby (1) | 2020.04.24 |
|---|---|
| pandas.pivot_table (0) | 2020.04.24 |
| pandas.drop_duplicates.reset_index (0) | 2020.04.24 |
| pandas.string2code (0) | 2020.04.24 |
| pandas.get_dummies.ont-hot-incoding (0) | 2020.04.24 |
| pandas.unstack(벡터로 펼치기(인덱스 두개)) (0) | 2020.04.06 |
| pandas.groupby (1) | 2020.04.06 |
| pandas. 항목 추가 (0) | 2020.04.06 |
Comments