일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- gas
- PostgreSQL
- numpy
- Redshift
- Java
- hive
- math
- Tkinter
- google apps script
- matplotlib
- Excel
- Python
- Mac
- list
- GIT
- PANDAS
- c#
- Github
- PySpark
- SQL
- Kotlin
- array
- Google Excel
- 파이썬
- dataframe
- string
- Google Spreadsheet
- django
- Apache
- Today
- Total
목록분류 전체보기 (832)
달나라 노트
Table의 생성 시점을 보기 위해선 아래 query를 실행하면 됩니다. select nspname as schema_name , relname as table_name , relcreationtime as creation_time from pg_class_info as pci -- left join pg_namespace as pns on pns.oid = pci.relnamespace -- where pci.reltype != 0 and pns.nspname = 'schema_name' and pci.relname = 'table_name' ;
select *from pg_tables; Redshift에서는 pg_table를 이용하면 database에 있는 table의 종류와 각 tabe의 owner를 알 수 있습니다. 위 쿼리의 output column은 아래 링크를 보면 됩니다.https://www.postgresql.org/docs/8.0/view-pg-tables.html pg_tablesThe view pg_tables provides access to useful information about each table in the database. Table 41-37. pg_tables Columns Name Type References Description schemaname name pg_namespace.nspname name ..
set timezone syntax를 이용하면 특정 지역에 대한 시간대를 설정할 수 있습니다. 즉, 서버에 기본으로 적용되어있는 시간대를 무시하고 내가 설정한 시간대를 이용할 수 있습니다. Syntax set timezone to 'area' area는 원하는 지역의 이름을 의미합니다. set timezone to 'Asia/Seoul'; 위 구문을 실행하면 Asia의 Seoul로 timezone이 설정됩니다. set timezone to 'America/New_York' 위 구문은 America의 New_York으로 timezone을 설정합니다. set timezone to default; 위 구문은 system default값으로 timezone을 설정하며 보통 UTC를 의미합니다. 이렇게 timez..
transform method는 DataFrame에서 groupby로 집계한 결과를 동일한 index를 가진 행에 넣어서 return해줍니다. 말만 들으면 무슨 소린지 잘 감이 오지 않는데 실제 예시를 봅시다. import pandas as pd dict_item = { 'date': [ 20200101, 20200102, 20200103, 20200101, 20200102, 20200103, 20200101, 20200102, 20200103, 20200101, 20200102, 20200103, 20200104 ], 'item_id': [ 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4 ], 'item_name': [ 'a', 'a', 'a', 'b', 'b', 'b', 'c', ..