4 ms·
pandas.read_sql('select first_name, last_name, email from users', conn) this approach avoids the full data copy calling '.all()' materializes.
by michelpp 8y ago
pandas.read_sql('select first_name, last_name, email from users', conn)
this approach avoids the full data copy calling '.all()' materializes.
- fredley 8y ago.all() doesn't actually do anything, and could be omitted. The beauty of this setup is if you need to rewrite the implementation of .to_dataframe() to optimize it, you can (e.g. to remove the .values() you're worries about and use your above code)