sql을 활용하여 데이터프레임 join 등등 하기 위한 기본 구문
from pysqldf import SQLDF
import pandas as pd
import io
txt = io.StringIO("""
col1 col2
a 1
b 2
c 3
d 4
""")
df = pd.read_csv(txt, sep="\t")
df
sqldf = SQLDF(globals())
sqldf.execute("select * from df limit 3;")
'언어 꿀Tip > Python 꿀tip!' 카테고리의 다른 글
07_02_02. [codility] CyclicRotation python (0) | 2021.08.23 |
---|---|
07_02_01. [codility] OddOccurrencesInArray collection 모듈 Counter 이용 (0) | 2021.08.23 |
07_01_70. 두 list 중복값 추출하기 (0) | 2021.07.27 |
07_01_69. list 내 값 중복 제거 (0) | 2021.07.26 |
07_01_68. pd.pivot_table 컬럼명 prefix (0) | 2021.07.23 |