Coder Social home page Coder Social logo

one-billion-rows-challenge's Introduction

One Billion Rows Challenge

This repository represents Project 01 from the Data Engineering BOOTCAMP, where the objective is to compare different ways of reading one billion rows in Python. Upon cloning the original repository, the objective is to implement script modifications based on the concepts learned in previous bootcamp classes, such as type hints and functions.

From the original repository, a decorator function was implemented to measure the execution time of each script function responsible for reading the file. Minor structural adjustments, such as introducing a type hint in the path variable, were made to the scripts. Additionally, the Dask script was intentionally excluded, narrowing the comparison to Python (native structure), Pandas, Polars, and DuckDB.

Results

Machine specifications:

  • 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz 2.42 GHz
  • 16G RAM
Enviroment Execution Time
Python 46 min 37 s
Python + Pandas 6 min 36 s
Python + Polars 38 s
Python + Duckdb 33 s

How To Run

How to execute this repository in a bash terminal using pyenv and poetry.

Before you begin, ensure that measurements.txt is inside .gitignore

  1. Clone the repository:
git clone https://github.com/lealre/one-billion-rows-challenge.git
  1. Enter the folder:
cd one-billion-rows-challenge
  1. Set Python version using pyenv:
pyenv local 3.12.1
  1. Set poetry to use Python 3.12.1:
poetry env use 3.12.1
  1. Install dependencies and activate the virtual environment:
poetry install --no-root
poetry lock --no-update
poetry shell
  1. Create the measurements.txt file (takes some time to create):
python src/create_measurements.py
  1. Read the file using specific script:
python src/using_python.py 
python src/using_pandas.py 
python src/using_polars.py 
python src/using_duckdb.py 

THIS IS A CLONE FROM THIS REPO! The scripts designed to read the file are not authored by me.

one-billion-rows-challenge's People

Contributors

lvgalvao avatar lealre avatar arthurj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.