cara mengambil baris terbatas di pandaframe menggunakan sqlalchemy
import sqlalchemy as db
import pandas as pd
engine = db.create_engine('sqlite:///traffic.sqlite') # just for example
con=engine.connect()
dbqu=con.execute("SELECT * FROM vehicles")
## use fetchmany(size=x) instead of fetchall() to fetch x number of rows
df=pd.DataFrame(dbqu.fetchmany(size=20))
con.close()
Asir In Tisar