본문 바로가기

전체 글195

open dataset - heterogeneous graph https://www.biendata.xyz/hgb/#/datasets HGB Reset password Please enter your registration email to reset your password. Reset Password via Phone Send email www.biendata.xyz 2021. 11. 8.
[pandas] group by 하여 counter 컬럼 추가 df = pd.DataFrame(columns=['name','age','city']) df =df.append({'name':'kim','age':1, 'city':2}, ignore_index= True) df =df.append({'name':'kim','age':1, 'city':2}, ignore_index= True) df =df.append({'name':'park','age':1, 'city':5}, ignore_index= True) df =df.append({'name':'kim','age':2, 'city':5}, ignore_index= True) df =df.append({'name':'park','age':2, 'city':2}, ignore_index= True) df =df... 2021. 6. 10.
[SQL] insert into/ overwrite / create table .. like .. INSERT OVERWRITE dest_table SELECT l_orderkey, l_partkey, l_quantity FROM source_table; 테이블 dest_table, source_table는 스키마가 같아야 하고, dest_table의 테이블 내용 전체가 없어지고 select~ 이하가 dest_table 에 들어간다 (테이블 교체) INSERT INTO dest_table (col1, col2, ...) VALUE (v1, v2 , ...); 테이블 dest_table에 직접 값을 넣어주는 insert. dest_table의 기존 값 보존 (append) INSERT INTO dest_table ( col1, col2, .. ) SELECT col1, col2, .. FROM sour.. 2021. 5. 12.
Python: Function annotations python 3 에서 부터 작동하는 기능 함수의 input, output을 주석에 적어주는게 아니라, annotations 라는 기능으로 명시하는것 사용법 > def func(a: int, b: int = 5) -> float: return float(a+b) print(func(5)) 이렇게 쓰는데, print(func.__annotations__) 이렇게 함수의 __annotations__ 속성값을 보면 {'a': , 'b': , 'return': } input, output을 찾아 볼 수 있다. 이외에 장점은 명시적으로 input, output을 지정함으로 각종 IDE에서 auto-compleation이 더 잘 working한다 다만 annotation들은 모두 강제성이 없기 때문에 지키지 않아도 .. 2021. 4. 30.