Pandas iloc to TOP / OFFSET FETCH

iloc is positional. SQL has no stable position without ORDER BY. Write the order.

SELECT TOP 10 * FROM Orders ORDER BY order_id;
SELECT * FROM Orders ORDER BY order_id
OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY;

iloc[:, 0:3] is the first three columns — name them. Do not rely on ordinals.

Canonical translation

SELECT TOP 10 * FROM Orders ORDER BY order_id;
SELECT * FROM Orders ORDER BY order_id
OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY;

Then write it on a ticket

Monday is free. A colleague asks, you type, we mark it.

Clock in free