DEV Community

Cover image for A Guide to Data Analytics with DuckDB

Posted on

A Guide to Data Analytics with DuckDB

The life of a data analyst revolves around loading data through SQL serve, analyzing it using various Python packages, and finally creating the technical report. Sometimes these SQL queries can take a longer time to process as we are dealing with terabytes of data. In this fast-paced world, this strategy fails miserably and most analytics are moving away from traditional ways to doing data analytics. DuckDB solves all the issues, it is integrated with Python & R. It works similarly to SQLite and focuses on providing faster analytical queries.

Sample Code

res = duckdb.query(SELECT sex, SUM(expected_recovery_amount) as Expected,
 SUM(actual_recovery_amount) as Actual 
 FROM bank_data.csv
 WHERE recovery_strategy LIKE Level 4 Recovery
 HAVING sex = Female’”)
Enter fullscreen mode Exit fullscreen mode

code result
Read full guide on Analytics Vidhya

Discussion (0)