Using DuckDB Python client, I want to iterate over the results returned from query like
import duckdb
employees = duckdb.sql("select * from 'employees.csv' ")
Using type(employees) returns 'duckdb.duckdb.DuckDBPyRelation'. I'm able to get the number of rows with len(employees), however for-loop iteration seems to not work.
What is the correct way to process each row at a time?
Apparently, from DuckDB API, something like the following should work.
I unfortunately cannot test it because DuckDB's package won't install for whatever reason.
I hope this helps you get in the right path to finding your answer.