일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- numpy
- 파이썬
- array
- dataframe
- Java
- Github
- PANDAS
- Tkinter
- google apps script
- string
- Python
- django
- Mac
- c#
- list
- Kotlin
- math
- Redshift
- Google Excel
- GIT
- PostgreSQL
- hive
- SQL
- PySpark
- Apache
- Excel
- Google Spreadsheet
- matplotlib
- Today
- Total
목록분류 전체보기 (832)
달나라 노트
Redshift에서 json_extract_array_element_text() 함수는 indexing을 통해 array에서 값을 추출해줍니다. Syntax json_extract_array_element_text(json_array_text, index) 사용법은 위와 같습니다. json_array_text -> JSON array 형태로 된 text를 받습니다. index -> 추출할 index의 번호를 의미합니다. select '["apple", "banana", "pineapple", "peach"]' as json_arr_text , json_extract_array_element_text(json_arr_text, 0) as col0 , json_extract_array_element_text..
Redshift에서 json_extract_path_text() 함수를 사용하면 JSON 형태로 존재하는 text를 JSON을 다루듯이 사용할 수 있습니다. Syntax json_extract_path_text(json_text, key1, key2, ...) 사용법은 위와 같습니다. 첫 번째 인자로 JSON 형태의 텍스트를 받습니다. 그리고 두번째부터는 JSON에 있는 key값을 적어주면 됩니다. select '{"apple": 20000, "banana": 8000, "peach": 22000}' as json_string , json_extract_path_text(json_string, 'apple') --> 20000 , json_extract_path_text(json_string, 'bana..
pandas의 rank() method는 특정 column을 기준으로 ranking을 매겨줍니다. Syntax rank(ascending={True, False}, method={'min', 'max', 'dense', 'first', 'average'}, pct={True, False}, na_option={'keep', 'top', 'bottom}, numeric_only={True, False}) - ascending (default = True) True -> ranking을 매길 때 오름차순으로 정렬하여 rank를 매김. 따라서 원본 데이터가 더 작은 값일수록 더 1위에 가까운 rank를 얻게 됨. False -> ranking을 매길 때 내림차순으로 정렬하여 rank를 매김. 따라서 원본 데이..
pandas의 sample method는 DataFrame에서 랜덤한 행을 추출해줍니다. Syntax DataFrame.sample(frac=float, replace=True/False, ignore_index=True/False) - frac 이 옵션은 0~1 사이의 실수를 받습니다. fraction의 약자로 원본 DataFrame의 존재하는 row의 개수 중 몇%를 추출할지를 결정합니다. 0.5는 원본 DataFrame에 존재하는 row의 개수가 10개라면 그의 50%인 5개만 추출합니다. 1은 원본 DataFrame에 존재하는 row의 개수가 10개라면 그의 100%인 10개를 추출합니다. - replace 이 옵션은 행을 중복되게 추출하는걸 허용할지를 결정합니다. replace = True ->..