일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- matplotlib
- Kotlin
- Google Spreadsheet
- numpy
- PySpark
- Python
- Java
- math
- Mac
- list
- google apps script
- django
- PostgreSQL
- GIT
- Github
- Apache
- string
- hive
- Tkinter
- Excel
- 파이썬
- dataframe
- gas
- array
- SQL
- Google Excel
- PANDAS
- Redshift
- c#
- Today
- Total
목록분류 전체보기 (832)
달나라 노트
first_value, last_value는 window function으로서 이용 가능합니다. first_value([column_name]) over(partition by [column_name] order by [column_name] rows between ~~ and ~~) last_value([column_name]) over(partition by [column_name] order by [column_name] rows between ~~ and ~~) 예시를 보면 위처럼 사용할 수 있습니다. 해석을 해보면 partition by [column_name] = 이 컬럼을 parititon으로 나눠서 order by [column_name] = 이 컬럼 기준으로 정렬을 한 후 first_va..
Syntax date_trunc('datepart', date/timestamp) date_trunc 함수는 위처럼 사용할 수 있습니다. 주어진 date를 명시한 datepart까지만 남기고 그 이하는 모두 자른 후 timestamp를 반환합니다. select current_date; --> 2021-02-18 select date_trunc('year', current_date); -->2021-01-01 00:00:00.000000 select date_trunc('month', current_date); -->2021-02-01 00:00:00.000000 select date_trunc('week', current_date); -->2021-02-15 00:00:00.000000 select da..
Python에서 File 생성 또는 쓰기 Python에서 파일을 생성하거나 읽거나 파일에 값을 입력할 때에는 open 함수로 파일을연 후 마지막에 close 함수를 이용하여 파일을 닫아주어야 합니다. open(파일 경로, 모드) open 함수의 syntax는 위와 같습니다. 내가 다룰 파일의 경로를 적어줍니다. 이때 내가 다룰 파일의 이름까지 모두 적어줘야합니다. 모드는 내가 해당 파일을 열 때 읽기모드, 쓰기모드, 추가모드 중 어떤 모드를 사용할지를 명시합니다. 모드는 다음과 같은 세 가지가 있습니다. r = 읽기 모드 - 파일을 읽기만 할 때 w = 쓰기 모드 - 파일에 내용을 쓸 때(기존 내용은 지워지고 새로 내용이 들어감.) a = 추가 모드 - 파일의 마지막에 새로운 내용을 추가할 때 f = o..
import ftplib s3_host = '11.111.111.111' s3_user_id = 'user_1' s3_user_password = 'pw_1' ftp = ftplib.FTP() ftp.encoding = 'utf-8' ftp.connect(s3_host) # connect to s3 ftp.login(s3_user_id, s3_user_password) # login to s3 csv_to_upload = 'test.csv' file = open(csv_to_upload, 'rb') ftp.storbinary('STOR '+ csv_to_upload, file) print('File list :', ftp.nlst()) file.close() ftp.quit() # quit s3 - Ou..