일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- Github
- matplotlib
- PySpark
- Google Excel
- Tkinter
- Apache
- Mac
- Java
- GIT
- numpy
- hive
- string
- Kotlin
- PANDAS
- google apps script
- SQL
- Redshift
- 파이썬
- PostgreSQL
- Python
- c#
- list
- django
- dataframe
- array
- Excel
- Google Spreadsheet
- math
- gas
- Today
- Total
목록분류 전체보기 (847)
달나라 노트
임시 테이블을 만드는 방법은 create temp table을 이용하면 됩니다. 근데 with 구문을 이용하여 위와 비슷한 기능을 사용할 수 있습니다. with valid_user as ( selectui.userkey from user.user_info as ui -- where 1=1 and ui.valid = 1 ), user_address as ( selecta.address_code from user.address as a -- where 1=1 and a.valid = 1 ) -- select* from order.order_list as ol -- join valid_user as vu on vu.userkey = ol.userkey join user_address as ua on ua.ad..
create table test_schema.test_table ( col1 varchar(max), col2 bigint(max), col3 varchar(max) ) ; create table은 위처럼 테이블을 생성시킬 수 있도록 합니다. 위 테이블은 col1, col2, col3라는 3개의 column을 가질 것이고, 각 컬럼에 들어갈 값들의 datatype은 순서대로 varchar(문자), bigint(정수), varchar(문자)입니다. create table if not exists test_schema.test_table ( col1 varchar(max), col2 bigint(max), col3 varchar(max) ) ; 또한 if not exists라는 옵션을 추가할 수도 있습니다...
Python의 strip, lstrip, rstrip은 다음과 같은 기능을 가집니다. strip = 문자열의 양쪽 끝에 있는 어떤 텍스트를 제거합니다. lstrip = 문자열의 왼쪽 끝에 있는 어떤 텍스트를 제거합니다. rstrip = 문자열의 오른쪽 끝에 있는 어떤 텍스트를 제거합니다. str_test = ' abcde ' str_stripped = '[' + str_test.strip() + ']' str_lstripped = '[' + str_test.lstrip() + ']' str_rstripped = '[' + str_test.rstrip() + ']' print(str_stripped) print(str_lstripped) print(str_rstripped) - Output [abcde] ..
DataFrame의 fillna는 DataFrame에 존재하는 NaN값을 어떠한 값으로 채워줍니다. import pandas as pd import numpy as np dict_test = { 'col1': [1, 2, np.nan, 4, np.nan], 'col2': [np.nan, 'a', 'b', np.nan, 'z'], } df_test = pd.DataFrame(dict_test) print(df_test) df_filled = df_test.fillna('n') print(df_filled) - Output col1 col2 0 1.0 NaN 1 2.0 a 2 NaN b 3 4.0 NaN 4 NaN z col1 col2 0 1 n 1 2 a 2 n b 3 4 n 4 n z 위 예시를 보면 d..