반응형
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 |
Tags
- web 사진
- bccard
- cudnn
- web 개발
- CES 2O21 참가
- tensorflow
- 웹 용어
- 대이터
- paragraph
- mglearn
- web 용어
- html
- 머신러닝
- CES 2O21 참여
- broscoding
- discrete_scatter
- Keras
- postorder
- 데이터전문기관
- 자료구조
- C언어
- KNeighborsClassifier
- classification
- 결합전문기관
- pycharm
- inorder
- web
- vscode
- java역사
- 재귀함수
Archives
- Today
- Total
bro's coding
pandas.dt(날짜 다루기) 본문
반응형
data2=data
data2['year']=data2.사용일자/10000
data2['month']=(data2.사용일자%10000)//100
data2['day']=data2.사용일자%100
theday=pd.to_datetime(data2.사용일자,format='%Y%m%d')
#교재 426 (format)
ser=pd.Series(['2020-4-1','2020-4-2'])
ser=pd.to_datetime(ser)

ser.dt.year

data2['year']=theday.dt.year
data2['month']=theday.dt.month
data2['day']=theday.dt.day
wday={0:'월',1:'화',2:'수',3:'목',4:'금',5:'토',6:'일'}
data2['wday']=theday.dt.dayofweek.map(wday)
data2.tail()

set(range(1,32))-set(data2.day)

data2[data2.wday=='월'].head()

반응형
'[IT] > python.pandas' 카테고리의 다른 글
| pandas.value_count (0) | 2020.04.06 |
|---|---|
| pandas.카테고리 알기 (0) | 2020.04.06 |
| pandas.corr, cov(상관 관계) (0) | 2020.04.06 |
| pandas.데이터 다루기 (0) | 2020.04.06 |
| pandas.basic (0) | 2020.04.06 |
| pandas.개념 (0) | 2020.04.03 |
| pandas.ndarray 다루기 (0) | 2020.03.26 |
| pandas.file open(csv) (0) | 2020.03.26 |
Comments