반응형
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
- GIT
- Apache
- string
- list
- Tkinter
- c#
- Google Spreadsheet
- PostgreSQL
- Presto
- Google Excel
- gas
- PANDAS
- Github
- math
- PySpark
- Excel
- 파이썬
- array
- matplotlib
- dataframe
- Java
- hive
- Python
- django
- Kotlin
- Redshift
- google apps script
- SQL
- numpy
Archives
- Today
- Total
목록Python (387)
달나라 노트
Python datetime : fromtimestamp (Unix timestamp를 날짜로 변환하기)
import datetime d = datetime.date.fromtimestamp(1583644364) print(d) - Result 2020-03-08 date 객체 생성 시 년, 월, 일을 받지 않고 fromtimestamp method를 사용하여 Unix timestamp를 날짜로 변환하여 얻을 수 있습니다. Unix timestamp는 1970년 1월 1일(UTC)부터 몇 초가 흘렀는지를 나타내는 수치입니다.
Python/Python datetime
2020. 12. 23. 02:39
Python datetime : date (숫자들을 조합하여 날짜 만들기)
import datetime d = datetime.date(2020, 3, 8) print(d) - Result 2020-03-08 date method는 date class의 생성자입니다. date class는 날짜 관련 데이터를 가지기 때문에 date class를 생성하는 date method는 3가지 값(년, 월, 일)을 받아야합니다.
Python/Python datetime
2020. 12. 23. 02:38
Python calendar : monthrange (특정 월의 시작 요일과 해당 월의 총 일수)
import calendar print(calendar.monthrange(2020, 3)) - Output (6, 31) calendar.monthrange 함수는 2020년 3월의 시작일 즉, 2020년 3월 1일의 요일과 2020년 3월이 최대 몇일까지 있는지를 Tuple의 형태로반환합니다. 2020년 3월 1일은 6(일요일)이며, 2020년 3월은 31일까지 존재한다는 결과가 반환된 것을 볼 수 있습니다. 각 요일별 index 번호는 아래와 같습니다. 월요일 = 0 화요일 = 1 수요일 = 2 목요일 = 3 금요일 = 4 토요일 = 5 일요일 = 6
Python/Python calendar
2020. 12. 23. 02:31